Why sometimes android studio doesn't print stacktrace in logcat - android

I use Retrofit 2.8.1 to make a network call. When I disable my network connection, the app crashes. But strangely I've got nothing about stack trace on logcat. Just says:
E/AndroidRunTime: FATAL EXEPTION: main
Process: ir.kaaveh.recyclerviewmvvm, PID: 31179
When I surround my network call with try/catch and use e.printStackTrace(), I find out that:
java.net.UnknownHostException: Unable to resolve host "www.omdbapi.com": No address associated with hostname
Why Android studio don't show me stack trace in this case? Usually, it tells you which line causes throw exception.
You can find the full source code here.

Related

Getting error while using LookAtMe feature in Android-

I am trying to use the LookAtMe feature, when running from MainActivity, it runs absolutely fime but while trying to run on a button click from a different activity , I getting below error. tried all possible options but not able to resolve it, any help is highly appreciated-
I am getting this error on line : lookAtMe.init(com.example.videoexample.VVedio.this);
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.videoexample, PID: 12517
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbgl;
at com.pd.lookatme.LookAtMe.createCameraSource(LookAtMe.java:222)
at com.pd.lookatme.LookAtMe.init(LookAtMe.java:35)
at com.example.videoexample.VVedio$1.onClick(VVedio.java:40)
at android.view.View.performClick(View.java:6642)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View.performClickInternal(View.java:6619)
at android.view.View.access$3100(View.java:790)
at android.view.View$PerformClick.run(View.java:26189)

Error in Huawei phone. Fatal Exception: java.lang.NullPointerException at com.google.android.gms.ads.internal.video.exoplayer3.a.b

I only get errors on the huawei phone
Fatal Exception: java.lang.NullPointerException at com.google.android.gms.ads.internal.video.exoplayer3.a.b.
I'm not an intern. So I know what is the usual NullPointerException error. In my question, the error only occurs on 1 single device and can not find details in the crashlytics report. So if you can not provide a help answer, please do not flag or report duplicates when you do not know what it is.

How can I black-box a library in the android debugger

I'm using khttp to perform HTTP requests in my Android app, but every time I start adding breakpoints to my app in Android Studio 3.1, I'm getting this really annoying Illegal State Exception, at which point I them need to restart Android Studio. Here's an example of the exception thrown:
E/AndroidRuntime: FATAL EXCEPTION: Thread-4
Process: com.sbrl.peppermint, PID: 10777
java.lang.IllegalStateException: Cannot access request header fields after connection is set
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getRequestProperties(HttpURLConnectionImpl.java:232)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getRequestProperties(DelegatingHttpsURLConnection.java:182)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getRequestProperties(Unknown Source:0)
at com.android.tools.profiler.support.network.httpurl.TrackedHttpURLConnection.getRequestProperties(TrackedHttpURLConnection.java:204)
at com.android.tools.profiler.support.network.httpurl.TrackedHttpURLConnection.trackPreConnect(TrackedHttpURLConnection.java:63)
at com.android.tools.profiler.support.network.httpurl.TrackedHttpURLConnection.connect(TrackedHttpURLConnection.java:126)
at com.android.tools.profiler.support.network.httpurl.HttpsURLConnection$.connect(HttpsURLConnection$.java:366)
at khttp.responses.GenericResponse.openRedirectingConnection$khttp(GenericResponse.kt:125)
at khttp.responses.GenericResponse.getConnection(GenericResponse.kt:163)
at khttp.responses.GenericResponse.getRaw(GenericResponse.kt:207)
at khttp.responses.GenericResponse.getContent(GenericResponse.kt:216)
at khttp.responses.GenericResponse.init$khttp(GenericResponse.kt:377)
at khttp.KHttp.request(KHttp.kt:61)
at khttp.KHttp.request$default(KHttp.kt:59)
I know that this question explains why this is happening, but my question is this:
How can I black-box the khttp library (similar to the way that Chrome allows you to black-box a JS source file), such that the Android debugger does not inspect it - throwing this exception?

StackOverflowError at Android View.setTranslationX

Our app crashed with the following stack trace:
Fatal Exception: java.lang.StackOverflowError
at android.view.View.setTranslationX(View.java:10287)
at android.view.View.setX(View.java:10237)
at <project-package>.ui.misc.FractionalFrameLayout.setXFraction(FractionalFrameLayout.java:44)
at android.animation.PropertyValuesHolder.nCallFloatMethod(PropertyValuesHolder.java)
at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:35)
at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:962)
at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:571)
at android.animation.ValueAnimator.end(ValueAnimator.java:984)
at android.animation.AnimatorSet.end(AnimatorSet.java:357)
We weren't able to reproduce the crash but there's one logged in crashlytics and it occurred in a Quanta device android version 4.4.2. Has anyone encountered such crash? Any help is appreciated.
EDIT
I checked the source code for android.view.View.java from GrepCode but the line on 10287 is only an initialization of the class TransformationInfo.

Android traces : Error during call stack reconstruction

I record traces on my android project by calling
Debug.startMethodTracing("MY AWESOME TRACE");
This usually works as a charm, but when trying to open my .trace file with Android Studio I get this issue :
Unexpected error while parsing trace file: Error during call stack reconstruction. Attempt to exit from method XXX while in method YYY
Has anyone encountered this error message ?
Cheers,

Categories

Resources