'Android Studio - How to display complete stack traces in logcat?

The Android app I'm working on is crashing as soon as it's launched, and I cannot figure out why. A stack trace would be useful, but logcat does not include it:

2022-02-25 12:28:35.191 22889-22889/net.bitsandpaper.companion I/SurfaceControl: assignNativeObject: nativeObject = 0 Surface(name=null)/@0x5ac5b48 / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9130 android.view.ViewRootImpl.performTraversals:3420 android.view.ViewRootImpl.doTraversal:2669 android.view.ViewRootImpl$TraversalRunnable.run:10092 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995 
2022-02-25 12:28:35.193 22889-22889/net.bitsandpaper.companion I/ViewRootImpl@e9ee47b[MainActivity]: Relayout returned: old=(0,0,1600,2560) new=(0,0,1600,2560) req=(1600,2560)0 dur=12 res=0x7 s={true 530306904064} ch=true fn=-1
2022-02-25 12:28:35.216 22889-22889/net.bitsandpaper.companion I/ViewRootImpl@e9ee47b[MainActivity]: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11078 android.view.ViewRootImpl.performTraversals:3915 android.view.ViewRootImpl.doTraversal:2669 
2022-02-25 12:28:35.216 22889-22889/net.bitsandpaper.companion I/ViewRootImpl@e9ee47b[MainActivity]: [DP] pd() Asnyc report
2022-02-25 12:28:35.217 22889-22889/net.bitsandpaper.companion I/ViewRootImpl@e9ee47b[MainActivity]: mAttachInfo.mThreadedRenderer.draw, mView = DecorView@2d1a4ac[MainActivity] w = 1600 h = 2560
2022-02-25 12:28:35.246 22889-23201/net.bitsandpaper.companion I/Gralloc4: mapper 4.x is not supported
2022-02-25 12:28:35.246 22889-23201/net.bitsandpaper.companion W/Gralloc3: mapper 3.x is not supported
2022-02-25 12:28:35.300 22889-22889/net.bitsandpaper.companion I/ViewRootImpl@e9ee47b[MainActivity]: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4743 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938 
2022-02-25 12:28:35.301 22889-22889/net.bitsandpaper.companion I/ViewRootImpl@e9ee47b[MainActivity]: [DP] rdf()
2022-02-25 12:28:35.309 22889-22889/net.bitsandpaper.companion E/AndroidRuntime: FATAL EXCEPTION: main
    Process: net.bitsandpaper.companion, PID: 22889
2022-02-25 12:28:35.857 22889-23190/net.bitsandpaper.companion W/System: A resource failed to call close. 
2022-02-25 12:28:35.857 22889-23190/net.bitsandpaper.companion W/System: A resource failed to call close. 

enter image description here

UPDATE - I removed code bits by bits for lack of a better debugging method. The crash is due to Retrofit. It seems it calls an URL that does not respond anymore.

Why is a 404 bringing down the whole app? More importantly, why does it does so silently?

Some code. Removing calls to AppApiService fixed the crash.

private const val BASE_URL = "https://obsolete-base-url/with/subpath"
private const val ENDPOINT = "version-check"

private val retrofit = Retrofit.Builder()
    .addConverterFactory(ScalarsConverterFactory.create())
    .baseUrl(BASE_URL)
    .build()

interface AppApiService {
    @GET(ENDPOINT)
    suspend fun getVersion() : String
}

object AppApi {
    val retrofitService : AppApiService by lazy {
        retrofit.create(AppApiService::class.java)
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source