i'm debuging a running app and see logcat in android studio, when the app have a error usually android studio will showing some error detail in logcat with the line where the error happened. but i just get some error detail like this
2019-09-04 08:50:46.894 11148-11148/id.co.hallo.hallo
E/AndroidRuntime: FATAL EXCEPTION: main
Process: id.co.hallo.hallo, PID: 11148
java.lang.ClassCastException: java.lang.String cannot be cast to id.co.hallo.hallo.support.ap
at id.co.hallo.hallo.ui.view.residence.setting.SettingResidence$c.run(Unknown
Source)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6238)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
what should i do to get the detail error with line code where the error happened?
First, you need to make sure the code in build.gradle proguard is set to false.
Second, the code you called maybe in a SDK/plugin, so it reminded "unKnown"
Hope it helps.
Most of the times the LogCat shows the line of code where the exception is raised, i recommend to you look in the LogCat for the message starting with:
Caused by
but in this case the exception is pretty obvious, an incorrect cast:
java.lang.ClassCastException: java.lang.String cannot be cast to
id.co.hallo.hallo.support.ap
and this error occur in the class:
id.co.hallo.hallo.ui.view.residence.setting.SettingResidence
Related
I updated Android Studio till 4.1.1, i updated everything for launching emulator AVD on API 30,
but i get "No tests were found" when i'm trying to launch my UI-tests (Espresso framework) on that emulator.
In the same time i have no any problems with emulator 29 or below.
--------- beginning of crash
2020-11-24 18:04:31.036 24852-24852 E/AndroidRuntime: FATAL EXCEPTION: main
PID: 24852
java.lang.IllegalArgumentException: Wrong number of arguments; expected 6, got 3
at java.lang.reflect.Method.invoke(Native Method)
at androidx.test.services.speakeasy.client.ToolConnection$ToolConnectionPostIcs.doCall(ToolConnection.java:197)
at androidx.test.services.speakeasy.client.ToolConnection.publish(ToolConnection.java:79)
at androidx.test.services.speakeasy.client.ToolConnection.publish(ToolConnection.java:69)
at androidx.test.services.shellexecutor.BlockingPublish.getResult(BlockingPublish.java:74)
at androidx.test.services.shellexecutor.ShellCommandExecutorServer.start(ShellCommandExecutorServer.java:80)
at androidx.test.services.shellexecutor.ShellMain.main(ShellMain.java:45)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
2020-11-24 18:04:31.036 24852-24852 E/AndroidRuntime: Error reporting crash
java.lang.RuntimeException: Bad file descriptor
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(BinderProxy.java:540)
at android.app.IActivityManager$Stub$Proxy.handleApplicationCrash(IActivityManager.java:5182)
at com.android.internal.os.RuntimeInit$KillApplicationHandler.uncaughtException(RuntimeInit.java:158)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2203)
2020-11-24 18:04:31.036 24852-24852 I/Process: Sending signal. PID: 24852 SIG: 9
Does anybody know what's the problem?
Thank a lot!
You should add permission WAKE_LOCK and increase androidx test orchestrator version. Also you should check actual versions for espresso core, rules and test runner.
My Project structure:
1- Kotlin app lib.
2-Java app calling methods from Kotlin lib.
From Java app I'm calling some methods from Kotlin lib. in development all works good and methods called successfully. after generating apk app starts with splash screen then crashes after getting location,
specifically when calling methods from Kotlin lib.
I think I missed something when generating apk with App and lib.
I tried this example and another about proguardFiles but no new result:
https://www.petrikainulainen.net/programming/gradle/getting-started-with-gradle-creating-a-multi-project-build/
the error:
2020-05-28 13:22:29.970 339-339/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.app, PID: 339
java.lang.NoSuchMethodError: No static method asAttributeSet(Lh/a/a/a;)Landroid/util/AttributeSet; in class Landroid/util/Xml; or its super classes (declaration of 'android.util.Xml' appears in /system/framework/framework.jar:classes2.dex)
at c.a.n.g.inflate()
at ui.activity.MainActivity.onCreateOptionsMenu()
at android.app.Activity.onCreatePanelMenu(Activity.java:3183)
at androidx.fragment.app.d.onCreatePanelMenu()
at c.a.n.i.onCreatePanelMenu()
at androidx.appcompat.app.f$j.onCreatePanelMenu()
at c.a.n.i.onCreatePanelMenu()
at androidx.appcompat.app.i.o()
at androidx.appcompat.app.i$a.run()
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
After updating for a new release of my app I'm getting this error crash repeatedly on the opening of the app and nothing else. This crash happening after few seconds of the opening of the app.
Error Log:
E/AndroidRuntime: FATAL EXCEPTION: Thread-3
Process: com.company.app, PID: 13304
java.lang.NoSuchMethodError: No direct method <init>(Lorg/apache/http/c/c;Lorg/apache/http/conn/scheme/SchemeRegistry;)V in class Lorg/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager; or its super classes (declaration of 'org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager' appears in /system/framework/org.apache.http.legacy.boot.jar)
at com.a.g.c.c(Unknown Source:54)
at com.a.g.c.a(Unknown Source:4)
at com.a.e.b.a(Unknown Source:0)
at com.a.e.b.b(Unknown Source:23000)
at com.a.d.b.c(Unknown Source:5000)
at com.a.d.b.b(Unknown Source:0)
at com.a.d.b.a(Unknown Source:4000)
at com.a.c.f.a(Unknown Source:12000)
at com.a.c.f$1.run(Unknown Source:4)
at com.a.a.b.b.a(Unknown Source:8)
at com.a.e.a(Unknown Source:51031)
at com.a.e.a(Unknown Source:0)
at com.a.e$4.run(Unknown Source:1000)
at com.a.e.o(Unknown Source:31)
at com.a.e.a(Unknown Source:45000)
at com.a.c.a(Unknown Source:20)
at com.a.c.b(Unknown Source:27000)
at com.a.c$1.run(Unknown Source:7)
at com.a.a.b.c.run(Unknown Source:8)
at com.a.a.b.d.run(Unknown Source:2000)
This error is showing in Logcat not getting on Crashlytics.
What are the main causes of this happening and how to solve this problem?
What are the main causes of this happening and how to solve this problem?
This is due to your apache classes are stripped by your proguard obfuscation step. Try to add -keep options for those apache classes. E.g.
-keep class org.apache.http.** { *; }
In my project i'm using the monetization service(Vungle/AppLovin).
When I'm trying to load an ad, i get this exception
E/AndroidRuntime: FATAL EXCEPTION: GoogleApiHandler
Process: kz.ikar, PID: 3673
java.lang.NoSuchMethodError: No virtual method setChannelId(Ljava/lang/String;)Landroid/support/v4/app/NotificationCompat$Builder; in class Landroid/support/v4/app/NotificationCompat$Builder; or its super classes (declaration of 'android.support.v4.app.NotificationCompat$Builder' appears in /data/app/kz.ikar-2oCl4DY4J8w7wP-jirbYvA==/split_lib_dependencies_apk.apk)
at com.google.android.gms.common.GoogleApiAvailability.zza(Unknown Source:225)
at com.google.android.gms.common.GoogleApiAvailability.zza(Unknown Source:15)
at com.google.android.gms.common.api.internal.zzbm.zzc(Unknown Source:4)
at com.google.android.gms.common.api.internal.zzbo.onConnectionFailed(Unknown Source:104)
at com.google.android.gms.common.api.internal.zzbo.connect(Unknown Source:83)
at com.google.android.gms.common.api.internal.zzbo.zza(Unknown Source:47)
at com.google.android.gms.common.api.internal.zzbm.handleMessage(Unknown Source:283)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
In my project I have two fragments in one activity. The user gets an ad in the second one. If I load an ad from the activity, it works well. What can be the cause of this issue?
By the way both ad networks(Vungle and AppLovin) return this exception
I had the same problem and I fixed it downgrading to firebase Google Play services 11.6.0
One reason you could be getting this error is if your buildToolsVersion in your app-level Gradle is less than 26. Either that or your v4 support is less than 26.0.0 seeing as NotificationCompat.Builder was added in API 26.
How do you find a hidden element inside an Android Webview using espresso? This is what I tried:
onWebView().withElement(findElement(Locator.CSS_SELECTOR, "#clsp:hidden"));
That produces the following stacktrace.
java.lang.RuntimeException: java.lang.RuntimeException: Error in
evaluationEvaluation: status: 13 value: {message=An invalid or illegal
selector was specified} hasMessage: true message: An invalid or
illegal selector was specified at
android.support.test.espresso.web.sugar.Web$WebInteraction$ExceptionPropagator.(Web.java:323)
at
android.support.test.espresso.web.sugar.Web$WebInteraction.doEval(Web.java:292)
at
android.support.test.espresso.web.sugar.Web$WebInteraction.withElement(Web.java:208)
at
com.middlestump.MainActivityInstrumentationTest.createAlert(MainActivityInstrumentationTest.java:89)
at java.lang.reflect.Method.invoke(Native Method) at
java.lang.reflect.Method.invoke(Method.java:372) at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
The MainActivityInstrumentationTest.java:89 bit is the line of code I have given.
Also tried:
onWebView().withElement(findElement(Locator.CSS_SELECTOR, "#clsp")).check(isDisplayed());
But there is a type mismatch between WebAssertion and ViewAssertion
Swipe webview and find the hidden element:
onView(withId(R.id.webView)).perform(ViewActions.swipeUp());