seconds after the App launches it crashes with this error in log:
07-27 11:27:33.261 27740-27740/com.msi.eluniversal E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.msi.eluniversal, PID: 27740
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 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
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.FirebaseInstanceIdService.zziB(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceIdService.zzA(Unknown Source)
at com.google.firebase.iid.zzb.onStartCommand(Unknown Source)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3916)
at android.app.ActivityThread.access$2300(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1780)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6843)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
07-27 11:27:39.151 27740-27881/com.msi.eluniversal E/GAv4: Successfully bound to service but never got onServiceConnected callback
07-27 11:29:03.581 27740-27740/com.msi.eluniversal I/Process: Sending signal. PID: 27740 SIG: 9
07-27 11:29:03.831 31553-31553/com.msi.eluniversal D/TimaKeyStoreProvider: TimaSignature is unavailable
07-27 11:29:03.841 31553-31553/com.msi.eluniversal D/ActivityThread: Added TimaKeyStore provider
07-27 11:29:03.851 31553-31553/com.msi.eluniversal I/ActivityThread: Switching default density from 640 to 480
07-27 11:29:03.851 31553-31553/com.msi.eluniversal I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=}
07-27 11:29:03.861 31553-31553/com.msi.eluniversal I/InjectionManager: Inside getClassLibPath caller
07-27 11:29:03.971 31553-31553/com.msi.eluniversal D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
07-27 11:29:03.981 31553-31553/com.msi.eluniversal A/FirebaseApp: Firebase API initialization failure.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
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.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1737)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1712)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:6384)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5979)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5919)
at android.app.ActivityThread.access$1700(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1743)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6843)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: 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 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
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)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
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.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1737)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1712)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:6384)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5979)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5919)
at android.app.ActivityThread.access$1700(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1743)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6843)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
07-27 11:29:03.981 31553-31553/com.msi.eluniversal D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
07-27 11:29:04.031 31553-31553/com.msi.eluniversal I/FA: App measurement is starting up, version: 9080
07-27 11:29:04.031 31553-31553/com.msi.eluniversal I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
07-27 11:29:04.081 31553-31553/com.msi.eluniversal D/FirebaseApp: Initialized class com.google.android.gms.measurement.AppMeasurement.
07-27 11:29:04.081 31553-31553/com.msi.eluniversal I/FirebaseInitProvider: FirebaseApp initialization successful
07-27 11:29:04.091 31553-31584/com.msi.eluniversal V/GoogleSignatureVerifier: com.google.android.gms signature not valid. Found
and I dont know how correct this error and i dont happen with Firebase or is GCM Google
I am using the next libraries:
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile 'com.google.android.gms:play-services-appindexing:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.google.android.gms:play-services-plus:9.0.0'
compile 'com.firebase:firebase-client-android:2.5.2'
and int he project gradle use this classpath:
classpath 'com.google.gms:google-services:3.0.0'
Related
Project build using Ionic. After generating Android build and import in Android SDK.
It gives error while running app in device/simulator. Also using FCM for push notifications.
Android runtime error after installing APK:
--------- beginning of crash
2018-05-04 16:34:30.077 14810-14810/com.app.name E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.name, PID: 14810
java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalArgumentException: Given String is empty or null
at android.app.ActivityThread.installProvider(ActivityThread.java:5856)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.IllegalArgumentException: Given String is empty or null
at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source)
at com.google.firebase.auth.api.internal.zzcq.<init>(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
at com.google.firebase.auth.internal.zzj.<init>(Unknown Source)
at com.google.firebase.auth.zzo.create(Unknown Source)
at com.google.firebase.components.zzi.zza(Unknown Source)
at com.google.firebase.components.zzj.get(Unknown Source)
at com.google.firebase.components.zzi.get(Unknown Source)
at com.google.firebase.components.ComponentContainer$$CC.get(Unknown Source)
at com.google.firebase.components.zzg.get(Unknown Source)
at com.google.firebase.components.zzg.zzb(Unknown Source)
at com.google.firebase.FirebaseApp.zzc(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:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Is there a problem with my configuration or is something missing while processing Android build?
I also had same issue and solved that problem now.
In my case, empty, or null value is "current_key" value in google-services.jsonso I fill the value (web API key) found in the Firebase console
I get an java.lang.NoSuchMethodError when I use the putFile method of a StorageReference object in Android.
I have the required dependencies in the app level gradle file ('com.google.firebase:firebase-storage:10.0.1' and 'com.google.firebase:firebase-database:10.0.1').
Here is the Error message:
06-05 02:28:29.530 15493-15493/packagename A/FirebaseApp: Firebase API initialization failure.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
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:1737)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1712)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:6475)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6070)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6010)
at android.app.ActivityThread.access$1700(ActivityThread.java:218)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6934)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzw; or its super classes (declaration of 'com.google.android.gms.common.util.zzw' appears in /data/app/packagename-2/split_lib_dependencies_apk.apk:classes19.dex)
at com.google.firebase.iid.zzh.zzeK(Unknown Source)
at com.google.firebase.iid.zzh.<init>(Unknown Source)
at com.google.firebase.iid.zzh.<init>(Unknown Source)
at com.google.firebase.iid.zzd.zzb(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
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:1737)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1712)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:6475)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6070)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6010)
at android.app.ActivityThread.access$1700(ActivityThread.java:218)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6934)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
And sometimes I get this Error message:
06-05 02:42:13.403 15493-15493/packagename E/AndroidRuntime: FATAL EXCEPTION: main
Process: packagename, PID: 15493
java.lang.NoSuchMethodError: No static method zzyv()Lcom/google/android/gms/common/util/zze; in class Lcom/google/android/gms/common/util/zzh; or its super classes (declaration of 'com.google.android.gms.common.util.zzh' appears in /data/app/packagename-2/split_lib_dependencies_apk.apk:classes19.dex)
at com.google.android.gms.internal.zzbqw.<clinit>(Unknown Source)
at com.google.firebase.storage.UploadTask.<init>(Unknown Source)
at com.google.firebase.storage.StorageReference.putFile(Unknown Source)
at packagename.PostActivity$2.onClick(PostActivity.java:80)
at android.view.View.performClick(View.java:5246)
at android.widget.TextView.performClick(TextView.java:10620)
at android.view.View$PerformClick.run(View.java:21256)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6934)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
The error happens here in the code (when I try to use putFile):
StorageReference filepath = mStorage.child("Pictures").child(mImageUri.getLastPathSegment());
filepath.putFile(mImageUri);
After a lot of searching and testing, I found out that not all Firebase UI libraries are compatible with any Firebase libraries.
Here is the list and the solution to the problem:
https://github.com/firebase/FirebaseUI-Android#compatibility-with-firebase--google-play-services-libraries
Scroll down on the linked page and the answer is there.
I am integrating Firebase Cloud Messaging Service in my Android app. Currently my app extends the Application class (named as MainApplication) and is declared in manifest application tag.
I have followed all the instructions to enable Firebase Cloud Messaging. When I run the app I receive below stack-trace
04-03 17:05:16.099 20911-20911/<package_name> E/FA: Failed to load metadata: Package name not found: android.content.pm.PackageManager$NameNotFoundException: : com.google.android.gms.internal.zzadf.getApplicationInfo(Unknown Source)
04-03 17:05:16.099 20911-20911/<package_name> E/FA: Scheduler not set. Not logging error/warn
04-03 17:05:16.099 20911-20911/<package_name> E/FA: Failed to load metadata: Package name not found: android.content.pm.PackageManager$NameNotFoundException: : com.google.android.gms.internal.zzadf.getApplicationInfo(Unknown Source)
04-03 17:05:16.099 20911-20911/<package_name> E/FA: Scheduler not set. Not logging error/warn
04-03 17:05:16.100 20911-20911/<package_name> V/FA: Collection enabled
04-03 17:05:16.100 20911-20911/<package_name> V/FA: App package, google app id: 1:744836320047:android:a611bb33ea5170ee
04-03 17:05:16.100 20911-20911/<package_name> I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app
04-03 17:05:16.100 20911-20911/<package_name> D/FA: Debug-level message logging enabled
04-03 17:05:16.103 20911-20911/<package_name> E/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:1748)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5262)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4847)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4787)
at android.app.ActivityThread.access$1600(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1452)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:234)
at android.app.ActivityThread.main(ActivityThread.java:5526)
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.SecurityException: Permission Denial: getIntentSender() from pid=20911, uid=10252, (need uid=-1) is not allowed to send as package
at android.os.Parcel.readException(Parcel.java:1627)
at android.os.Parcel.readException(Parcel.java:1579)
at android.app.ActivityManagerProxy.getIntentSender(ActivityManagerNative.java:4032)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:531)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:515)
at com.google.android.gms.internal.zzaup.zzpE(Unknown Source)
at com.google.android.gms.internal.zzaup.zzmS(Unknown Source)
at com.google.android.gms.internal.zzauh.initialize(Unknown Source)
at com.google.android.gms.internal.zzaue.<init>(Unknown Source)
at com.google.android.gms.internal.zzaui.zzMP(Unknown Source)
at com.google.android.gms.internal.zzaue.zzbM(Unknown Source)
at com.google.android.gms.measurement.AppMeasurement.getInstance(Unknown Source)
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:1748)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5262)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4847)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4787)
at android.app.ActivityThread.access$1600(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1452)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:234)
at android.app.ActivityThread.main(ActivityThread.java:5526)
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)
04-03 17:05:16.105 20911-20911/<package_name> I/FirebaseInitProvider: FirebaseApp initialization successful
Even the token is not generated. But when I remove the application name attribute from application tag in manifest i.e. not specifying my application class in manifest. The above error goes away and I get the token.
I have tried calling
FirebaseApp.initializeApp(this);
in onCreate of my application class, but still getting this error.
Currently I am using below Firebase version but have tried with earlier version also, but still receiving the error stack.
compile 'com.google.firebase:firebase-messaging:10.2.1'
It does not make sense to remove the extended Application class in order to use Firebase. Not sure what is needed to be done.
Thanks
I'm receiving following crash log when I run my app with firebase and google play services
Exception in Emulator:
11-10 17:14:39.716 2645-2645/com.winjit.musiclib.sample E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.winjit.musiclib.sample, PID: 2645
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.firebase.iid.zzg' appears in /data/app/com.winjit.musiclib.sample-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.FirebaseInstanceIdService.zziB(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceIdService.zzA(Unknown Source)
at com.google.firebase.iid.zzb.onStartCommand(Unknown Source)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3010)
at android.app.ActivityThread.-wrap17(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1442)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
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)
Exception in Device:
11-10 17:30:50.724 9161-9161/com.winjit.musiclib.sample E/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.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1801)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1776)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5464)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5037)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4977)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1562)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5769)
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)
Caused by: 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.firebase.iid.zzg' appears in /data/app/com.winjit.musiclib.sample-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)
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.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1801)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1776)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5464)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5037)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4977)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1562)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5769)
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)
11-10 17:30:50.866 9161-9195/com.winjit.musiclib.sample E/FA: Task exception on worker thread: 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.firebase.iid.zzg' appears in /data/app/com.winjit.musiclib.sample-1/base.apk): com.google.android.gms.measurement.internal.zzt.zzEd(Unknown Source)
Below is my gradle dependencies:
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.firebase:firebase-core:9.0.0'
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
Can someone help me to resolve this issue?
Try to compile
compile 'com.google.firebase:firebase-messaging:9.0.0'
instead of
compile 'com.google.firebase:firebase-core:9.0.0'
Also update to the latest google-play-services and google repository through the SDK Manager:
Try to use this solution. I had solved problem using above solution. I hope it will work for you.
Trying to implement GCM in my app. Compiled successfully. But when i run my app, Its crashing. Stack trace :
E/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.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5174)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
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.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.firebase.iid.zzg' appears in /data/app/sun.way2online.dropxapp-2/base.apk)
at com.google.firebase.iid.zzg.zzeC(Unknown Source)
at com.google.firebase.iid.zzg.(Unknown Source)
at com.google.firebase.iid.zzg.(Unknown Source)
at com.google.firebase.iid.zzd.zzb(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
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.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5174)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
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)
07-05 12:01:28.476 15753-15753/sun.way2online.dropxapp D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
And
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/app/sun.way2online.dropxapp-2/base.apk)
at com.google.android.gms.iid.zzd.zzeC(Unknown Source)
at com.google.android.gms.iid.zzd.(Unknown Source)
at com.google.android.gms.iid.zzd.(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at myapp.com.Services.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:29)
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)
My gradle file :
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile "com.google.android.gms:play-services-gcm:9.0.0"
}
apply plugin: 'com.google.gms.google-services'
The problem might comes from one of the libraries your app depends on, library that depends itself on Google Play Services as well. You might using an older version of the Google Play Services SDK and its still relies on the fact that Google API Client class is an interface. This breaks backward compatibility because of the transitive dependencies of libraries. Please check if you use the latest version or remove the dependecy if possible.
For more information regarding Google Play Services, check this link: https://www.reddit.com/r/androiddev/comments/3mehbb/breaking_changes_in_google_play_services_81/