So, I've had my app published for nearly a year without seeing this issue, and now it shows up.
Even right now, I don't have this issue with the debug version on my phone. I don't have any issues with any emulators opened from Android Studio. However nearly every emulator from the pre-launch reports in the Google Developer Console crashes with this NoSuchMethodError upon receiving Retrofit response.
FATAL EXCEPTION: ControllerMessenger
Process: xxxxxxx, PID: 25090
java.lang.NoSuchMethodError: No direct method <init>(Lcom/google/gson/Gson;)V in class Lcom/google/gson/Gson$1; or its super classes (declaration of 'com.google.gson.Gson$1' appears in /data/app/com.google.android.apps.mtaas.crawler-1/base.apk)
at com.google.gson.Gson.doubleAdapter(Gson.java:278)
at com.google.gson.Gson.<init>(Gson.java:217)
at com.google.gson.Gson.<init>(Gson.java:174)
at retrofit2.converter.gson.GsonConverterFactory.create(GsonConverterFactory.java:42)
at xxxxxxx.MtbActivity.loadJSON(MtbActivity.java:149)
at xxxxxxx.MtbActivity.onCreate(MtbActivity.java:135)
at android.app.Activity.performCreate(Activity.java:6013)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:215)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2359)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2466)
at android.app.ActivityThread.access$1200(ActivityThread.java:152)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1341)
at android.os.Handler.dispatchMessage(Handler.java:102)
at androidx.test.espresso.base.Interrogator.a(Interrogator.java:19)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:142)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:134)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:114)
at androidx.test.espresso.action.Tap$1.b(Tap.java:6)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:22)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:9)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:78)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:94)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:3)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5538)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
What I have tried:
Updated Retrofit and Gson dependencies to latest.
Invalidate caches and restarted
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
Thanks to Peter here
To summarize:
The existing crawler is FUBAR. As a workaround you can go back to the previous version of the crawler by opting out of the newly released one.
Here's how to opt-out:
Sign in to your Play Console.
Select an app.
Select Release management > Pre-launch report > Settings. In the “Pre-launch report version” section, move the Opt-out switch to the right until it turns blue.
After this, the launch reports appear correctly again.
Related
After implementing Facebook Account Kit and run project it shows Firebase API initialization failure as
FirebaseApp: Firebase API initialization failure.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(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:1758)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1733)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5257)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4808)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4748)
at android.app.ActivityThread.access$1700(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1436)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
And also getting Null Pointer Exception from AccountKitController as
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.PackageManager android.content.Context.getPackageManager()' on a null object reference
at com.facebook.accountkit.internal.Initializer.initialize(Initializer.java:101)
at com.facebook.accountkit.internal.AccountKitController.initialize(AccountKitController.java:601)
at com.facebook.accountkit.internal.AccountKitInitProvider.onCreate(AccountKitInitProvider.java:31)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1758)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1733)
at android.app.ActivityThread.installProvider(ActivityThread.java:5257)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4808)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4748)
at android.app.ActivityThread.access$1700(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1436)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
Using Account kit gradle as
compile 'com.facebook.android:account-kit-sdk:4.27.0'
And Firebase Gradle as
compile 'com.google.firebase:firebase-messaging:11.0.4'
Note : Removing Account Kit from project its working fine i.e. there is no Firebase API initialization failure. issue. Therefore it's sure that there is conflict in firebase and Account kit SDK (:
This is caused by Facebook's SDK being packaged with a different version of the GMS library than what is packaged with Firebase's. You can do something like this to get back up and running:
compile ('com.facebook.android:account-kit-sdk:4.27.0') {
exclude group: 'com.google.android.gms', module: 'play-services-auth-api-phone'
exclude group: 'com.google.android.gms', module: 'play-services-auth'
}
compile 'com.google.android.gms:play-services-auth:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
What this does is essentially hot-swaps out the older library for the newer one packaged with Firebase. It tells Facebook to compile without the old libs and then we make sure they are added back in with newer version right after.
For NullPointerException exception it seems that, Application is not initialized first, Content Providers are initialized before it.
And in Facebook account kit SDK's code it was trying to get my application context.
Now the problem was, I did implement method getApplicationContext() in application class that is getting application shared variable but that variable was setting globally and Facebook Account Kit sdk code getting Null application context.
Solution : setting shared variable in onCreate method instead of setting globally it resolved the problem of Unable to get provider.
And For Mixing issue, Account Kit SDK use 11.0.1 version for play services gradle and in my project I am having 11.0.4 that is actually not the issue because on compile time gradle takes latest gradle but In my project I am not referring below gradle which Facebook Account Kit SDK is using.
compile 'com.google.android.gms:play-services-auth-api-phone:11.0.1'
Solution : I have added above gradle with version 11.0.4 and the mixing gradle issue has been resolved.
compile 'com.google.android.gms:play-services-auth-api-phone:11.0.4'
And as suggested by #astryk if I exclude play-services-auth-api-phone module then gradle mixing error is not showing but it is not including that module becasue in AccountKitActivity on next button click my application crashes as
Crash Report Thread:main Exception:java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/auth/api/phone/SmsRetriever;
at com.facebook.accountkit.internal.PhoneLoginController.createSmsToken(PhoneLoginController.java:250)
at com.facebook.accountkit.internal.PhoneLoginController.logIn(PhoneLoginController.java:188)
at com.facebook.accountkit.internal.LoginManager.logInWithPhoneNumber(LoginManager.java:372)
at com.facebook.accountkit.internal.AccountKitController.logInWithPhoneNumber(AccountKitController.java:631)
at com.facebook.accountkit.ui.PhoneLoginFlowManager.logInWithPhoneNumber(PhoneLoginFlowManager.java:57)
at com.facebook.accountkit.ui.ActivityPhoneHandler.onPhoneLoginComplete(ActivityPhoneHandler.java:189)
at com.facebook.accountkit.ui.AccountKitActivity$1.onReceive(AccountKitActivity.java:176)
at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:297)
at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:46)
at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:116)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.auth.api.phone.SmsRetriever" on path: DexPathList[[zip file "/data/app/com.myapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.myappList item -1/lib/arm64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 16 more
Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.auth.api.phone.SmsRetriever
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 17 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available`
I have developed an Application for a device Manufacturer which will be Pre loaded as System Application into the Device. The Device Manufacturer has Pre loaded the system application and it is available in the system image of the device. Now the requirement from the client is to update this system Application through play store in the similar way Google Play Services is updated.
I have uploaded a higher version of Application on the Google play store and once I update the App , initially the App crashes and the update is not reflected on the device until the device is rebooted. But the Preloaded applications like Google Maps, Google Play Services gets updated as soon as it is downloaded from the play store.
I have followed the steps mentioned on Google Support for updating System App :Updating System App through Play Store (Scroll to last of the page)
Please Let me know if some one has any idea about this.
The crash logs that I am getting are as follows :
06-21 18:40:40.748 2577-2577/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.harman.panasonicaicollection, PID: 2577
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.harman.panasonicaicollection/com.harman.panasonicaicollection.activities.MainDashBoardActivity}: java.lang.ClassCastException: android.support.v7.widget.ContentFrameLayout cannot be cast to android.support.v7.widget.ContentFrameLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2419)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2479)
at android.app.ActivityThread.access$900(ActivityThread.java:152)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5429)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassCastException: android.support.v7.widget.ContentFrameLayout cannot be cast to android.support.v7.widget.ContentFrameLayout
at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:475)
at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:312)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:277)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.harman.panasonicaicollection.activities.MainDashBoardActivity.onCreate(MainDashBoardActivity.java:53)
at android.app.Activity.performCreate(Activity.java:6311)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2372)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2479)
at android.app.ActivityThread.access$900(ActivityThread.java:152)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5429)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I need both Firebase Cloud Messaging and Nearby support in my app.
The latest allowed Nearby version is 9.0.0. So, I have to use following dependencies:
//Firebase
compile ‘com.google.firebase:firebase-core:9.0.0'
compile ‘com.google.firebase:firebase-messaging:9.0.0'
//Nearby
compile ‘com.google.android.gms:play-services-nearby::9.0.0’
It compiles successfully but when I try to get Firebase instance app crashes with IllegalAccessError:
java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:114)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.firebase.iid.zzg' (declaration of 'com.google.firebase.iid.zzg' appears in /data/app/com.obolus.poc.customer-1/base.apk)
at com.google.firebase.iid.zzg.zzeC(Unknown Source)
at com.google.firebase.iid.zzg.<init>(Unknown Source)
at com.google.firebase.iid.zzg.<init>(Unknown Source)
at com.google.firebase.iid.zzd.zzb(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
Using of different versions for these components causes compile error. Firebase 10.0.1 without Nearby works fine but I need both.
How can I solve this issue?
Thanks.
Solution
Perhaps it's a bug but for now to ensure that play-services plugin will check available versions correctly place line
apply plugin: 'com.google.gms.google-services'
at the bottom of your build.gradle file (below the dependencies block).
Check out https://firebase.google.com/docs/android/setup#add_the_sdk
I think you are wrong the latest nearby is v10 the same as Firebase
use the following dependencies that are here under
com.google.android.gms:play-services-nearby:10.0.1
com.google.firebase:firebase-core:10.0.1
com.google.firebase:firebase-messaging:10.0.1
I'm using this Tutorial but after run app crash app and give me this error.
Error:
FATAL EXCEPTION: IntentService[]
Process: package-name, PID: 11869
java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/data/yadbegir.jfa.mansoor.com.yadbegir/files/instant-run/dex/slice-realm-optional-api_82aa9dab5d973e04cc1850ef40d4e3808a75f9c1-classes.dex)
at com.google.android.gms.iid.zzd.zzdL(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at package-name.service.GCMRegistrationIntentService.registerGCM(GCMRegistrationIntentService.java:33)
at package-name.service.GCMRegistrationIntentService.onHandleIntent(GCMRegistrationIntentService.java:25)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
Try to update Google Play Services library to version 9.0.2
The Google Play services version 9.0.1 release is now available. This release fixes the following issues with the version 9.0.0 release:
Fixes a class change compilation error with ContextCompat.getNoBackupFilesDir().
Fixes a known issue with serving Admob ads on devices without the Google Play services APK when your app uses ProGuard post-processing.
I'm trying to integrate MonkeyTalk automation into my pre-existing Android app that is built using gradle.
I followed the steps here: Android Studio and MonkeyTalk? and got the demo app working, but when I run it in my own application I get the following crash on the second screen. Any idea why this happens?
This particular stack trace is using L preview targeting SDK 19, but I've also seen a similar (less detailed) stack trace on a Galaxy S4 with SDK 18 on it.
07-21 15:35:18.394 14642-14642/com.example.android.debug E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.android.debug, PID: 14642
java.lang.VerifyError: Rejecting class com.example.android.activity.main.MainActivity because it failed compile-time verification (declaration of 'com.example.android.activity.main.MainActivity' appears in /data/app/com.example.android.debug-1.apk)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1572)
at android.app.Instrumentation.newActivity(Instrumentation.java:1062)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2157)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2317)
at android.app.ActivityThread.access$800(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5070)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:836)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:631)
Any idea what this means? I'm using Dagger for dependency injection, is that why it might not work?
You can try the latest version of the monkeytalk and i guess your problem will not occur again.