After integrating Paytm payments sdk, debug version is working properly but release build is crashing when getting the response from Paytm.
if minifyEnabled false means release build working fine, but must need minifyEnabled is true.
minifyEnabled true means com.pay.project.Paytm.PaytmWebview.a(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:104)
Error Log:
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.pay.project.android.test, PID: 23149 java.lang.NoSuchMethodError:
No static method wrap(Ljava/lang/Object;)Ljava/lang/Object; in class Lorg/b/c;
or its super classes (declaration of 'org.b.c' appears in
/data/app/com.pay.project.android.test-1/base.apk) at com.pay.project.Paytm.PaytmWebview.a(Unknown Source) `at android.os.Handler.handleCallback(Handler.java:822)`at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5774)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:681)
paytm gradel file changes to previous version of paytm, now it working fine.
Related
I have tested my app in debug mode. I have made debuggable as true in release build type in build.gradle file. When I run and test it it gives me following error
2022-10-20 13:17:16.300 26285-26285/com.metamagics.patientsapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.metamagics.patientsapp, PID: 26285
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.metamagics.pulsepatientsapp.d.h.a()' on a null object reference
at com.metamagics.pulsepatientsapp.fragments.a.V1(:487)
at com.metamagics.pulsepatientsapp.fragments.a$f.c(:1657)
at com.metamagics.pulsepatientsapp.utilities.b.b(:129)
at com.metamagics.pulsepatientsapp.utilities.b.onPostExecute(:10)
at android.os.AsyncTask.finish(AsyncTask.java:771)
at android.os.AsyncTask.access$900(AsyncTask.java:199)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:8057)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011)
I am not able to understand the issue, if anyone knows a better way to identify the error, I will be thankful.
If you debug a release build, it will still be minified according to your build.gradle file. Try to first set minifyEnabled = false for your release configuration. Probably the Stacktrace gives you the reason of your error. If not you might need to configure your proguard rules if minify is needed.
Tested Environment / Dependencies
Android Studio: Android Studio Arctic Fox Beta 2 and Bumblebee Canary 1
AGP: 7.1.0-alpha01
Firebase Analytics: com.google.firebase:firebase-analytics-ktx:19.0.0
Firebase Crashlytics: com.google.firebase:firebase-crashlytics-ktx:18.0.0
minifyEnabled: true
Proguard Config specifically for Firebase: None
What's happening
When I build my app with minifyEnabled = true and try to start the app, app crashes right after it launches with the following crash log:
2021-05-29 22:30:37.652 16541-16541/com.my.app.package.name E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.my.app.package.name, PID: 16541
java.lang.IncompatibleClassChangeError: Class j$.util.concurrent.i implements non-interface class e.a (declaration of 'j$.util.concurrent.i' appears in /data/app/~~xxxx==/com.my.app.package.name--xxxxxx==/base.apk!classes2.dex)
at com.google.firebase.components.x.<init>(:37)
at com.google.firebase.components.x.b(:44)
at com.google.firebase.components.n.t(:219)
at com.google.firebase.components.n.j(:138)
at com.google.firebase.components.n.<init>(:91)
at com.google.firebase.components.n.<init>(:45)
at com.google.firebase.components.n$b.e(:360)
at com.google.firebase.c.<init>(:427)
at com.google.firebase.c.p(:299)
at com.google.firebase.c.o(:267)
at com.google.firebase.c.n(:252)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(:51)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(:45)
at android.app.ActivityThread.installProvider(ActivityThread.java:7242)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6783)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6700)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7660)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Notes
Configuring minifyEnabled = false fixes the issue and app can start as expected.
Maybe it is related or dup of: java.lang.IncompatibleClassChangeError caused by R8 (AGP 7.0.0-beta02).
We had similar crashes in release since AGP 7.0.0-alpha12. The crashes are gone after updating the desugaring library to version 1.1.5.
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}
More info: https://issuetracker.google.com/issues/189244205
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)
I'm developing an Android app and I have a problem when I run the app in release mode. If I start the app in debug mode I get this type of message in the Logcat (the app doesn't start):
E/AndroidRuntime: FATAL EXCEPTION: GoogleApiHandler
Process: it.planner, PID: 27326
java.lang.SecurityException: In order to use mock mode functionality app it.planner must be selected as the mock location
application in developer settings.
at android.os.Parcel.readException(Parcel.java:2008)
at android.os.Parcel.readException(Parcel.java:1954)
at com.google.android.gms.internal.zzeu.zzb(Unknown Source:10)
at com.google.android.gms.internal.zzcfa.zzbj(Unknown Source:9)
at com.google.android.gms.internal.zzcfd.zzbj(Unknown Source:13)
at com.google.android.gms.internal.zzcfk.zzbj(Unknown Source:2)
at com.google.android.gms.internal.zzcee.zza(Unknown Source:4)
at com.google.android.gms.common.api.internal.zzm.zzb(Unknown Source:8)
at com.google.android.gms.common.api.internal.zzc.zza(Unknown Source:6)
at com.google.android.gms.common.api.internal.zzbo.zzb(Unknown Source:9)
at com.google.android.gms.common.api.internal.zzbo.zzaiw(Unknown
Source:82)
at com.google.android.gms.common.api.internal.zzbo.onConnected(Unknown
Source:16)
at com.google.android.gms.common.internal.zzac.onConnected(Unknown
Source:2)
at com.google.android.gms.common.internal.zzn.zzakr(Unknown Source:130)
at com.google.android.gms.common.internal.zze.zzw(Unknown Source:64)
at com.google.android.gms.common.internal.zzi.zzaks(Unknown Source:51)
at com.google.android.gms.common.internal.zzh.handleMessage(Unknown
Source:270)
at android.os.Handler.dispatchMessage(Handler.java:109)
at android.os.Looper.loop(Looper.java:166)
at android.os.HandlerThread.run(HandlerThread.java:65) E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
Obviously, if I select the mock location in Developer Options, the app starts and works fine.
If I install the release apk and I try to start the app, the app doesn't start and I get this kind of messagge in Logcat:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: it.planner, PID: 29448
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:2054)
at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:2077)
at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:678)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:632)
at it.planner.Home.mainMenu(Home.java:374)
at it.planner.Home.computeGeolocation(Home.java:487)
at it..planner.Home.access$100(Home.java:80)
at it.planner.Home$3$1.onLocationResult(Home.java:344)
at com.google.android.gms.internal.zzcff.zzu(Unknown Source:4)
at com.google.android.gms.common.api.internal.zzci.zzb(Unknown Source:8)
at com.google.android.gms.common.api.internal.zzcj.handleMessage(Unknown
Source:16)
at android.os.Handler.dispatchMessage(Handler.java:109)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7377)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)
There is no possibility to select the mock location once the app is in release mode, so it doesn't want to start. I've been dealing with this problem for many days. I also tried with minifyEnabled false in the Gradle file but it doesn't work.
The gradle file is the following:
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
debuggable true
}
}
sourceSets {
main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] }
debug {
manifest.srcFile 'src/main/AndroidManifest.xml'
}
}
This issue is probably because of the Fragment transaction was not committed using the proper API. try to find
transaction.commit();
and replace it with
transaction.commitAllowingStateLoss();
Some more discussion is here: https://github.com/OneBusAway/onebusaway-android/issues/529#issuecomment-224974339
I am building an Android App and everything works correctly for Android 5.+. However, for Android 4.x, I am getting the following error when I try to compile using Android Studio:
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.google.android.gms.R$string
at com.google.android.gms.common.internal.zzam.<init>(Unknown Source)
at com.google.firebase.FirebaseOptions.fromResource(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1064)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5181)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4733)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4666)
at android.app.ActivityThread.access$1300(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1439)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5455)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:966)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:733)
at dalvik.system.NativeStart.main(Native Method)
In my dependencies, I already tried both compile 'com.google.android.gms:play-services:+'
and also compile 'com.google.android.gms:play-services:9.8.0'.
I have been trying to find solutions online and people recommend to add Google Play Services dependencies, but I already did that. I had also tried compile 'com.android.support:multidex:1.0.0' but I do not think that would make any difference because in any case, I saw this message popping up in Android Studio:
"Instant Run does not support deploying build variants with multidex enabled, to a target with API level 20 or below.
To use Instant Run with a multidex enabled build variant, deploy to a target with API level 21 or higher."
Any hints? Thank you.
The solution was simply adding the following code in my class that extended Application:
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
The solution was at java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzmp, so this question could be marked as duplicate.