Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin.Android App crash on start with Firebase after upgrading Xamarin.Azure.NotificationHubs.Android v1.1.4.1

After upgrading Xamarin.Azure.NotificationHubs.Android Nuget from ancient 0.6 to 1.1.4.1 (which involves also upgrade from Support libs to AndroidX) in my App - Everything is OK without Azure Notification Hub and FireBase Nugets (and commenting code which use them). With these Azure/FCM NuGets I get Exception when starting App:

[AndroidRuntime] Shutting down VM
[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] Process: com.taphome.android.next, PID: 12930
[AndroidRuntime] java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/datatransport/runtime/ExecutionModule_ExecutorFactory;
[AndroidRuntime]    at com.google.android.datatransport.runtime.DaggerTransportRuntimeComponent.initialize(DaggerTransportRuntimeComponent.java:75)
[AndroidRuntime]    at com.google.android.datatransport.runtime.DaggerTransportRuntimeComponent.<init>(DaggerTransportRuntimeComponent.java:66)
[AndroidRuntime]    at com.google.android.datatransport.runtime.DaggerTransportRuntimeComponent.<init>(DaggerTransportRuntimeComponent.java:36)
[AndroidRuntime]    at com.google.android.datatransport.runtime.DaggerTransportRuntimeComponent$Builder.build(DaggerTransportRuntimeComponent.java:109)
[AndroidRuntime]    at com.google.android.datatransport.runtime.TransportRuntime.initialize(TransportRuntime.java:78)
[AndroidRuntime]    at com.google.firebase.datatransport.TransportRegistrar.lambda$getComponents$0(TransportRegistrar.java:37)
[AndroidRuntime]    at com.google.firebase.datatransport.TransportRegistrar$$Lambda$1.create(Unknown Source:0)
[AndroidRuntime]    at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0(ComponentRuntime.java:132)
[AndroidRuntime]    at com.google.firebase.components.ComponentRuntime$$Lambda$1.get(Unknown Source:4)
[AndroidRuntime]    at com.google.firebase.components.Lazy.get(Lazy.java:53)
[AndroidRuntime]    at com.google.firebase.components.AbstractComponentContainer.get(AbstractComponentContainer.java:27)
[AndroidRuntime]    at com.google.firebase.components.RestrictedComponentContainer.get(RestrictedComponentContainer.java:89)
[AndroidRuntime]    at com.google.firebase.messaging.FirebaseMessagingRegistrar.lambda$getComponents$0$FirebaseMessagingRegistrar(Unknown Source:43)
[AndroidRuntime]    at com.google.firebase.messaging.FirebaseMessagingRegistrar$$Lambda$0.create(Unknown Source:0)
[AndroidRuntime]    at android.os.Looper.loop(Loope02-05 23:18:04.900 E/AndroidRuntime(12930):  at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0(ComponentRuntime.java:132)
[AndroidRuntime]    at com.google.firebase.components.ComponentRuntime$$Lambda$1.get(Unknown Source:4)
[AndroidRuntime]    at com.google.firebase.components.Lazy.get(Lazy.java:53)
[AndroidRuntime]    at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(ComponentRuntime.java:281)
[AndroidRuntime]    at com.google.firebase.FirebaseApp.initializeAllApis(FirebaseApp.java:584)
[AndroidRuntime]    at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:303)
[AndroidRuntime]    at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:267)
[AndroidRuntime]    at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:252)
[AndroidRuntime]    at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51)
[AndroidRuntime]    at android.content.ContentProvider.attachInfo(ContentProvider.java:2113)
[AndroidRuntime]    at android.content.ContentProvider.attachInfo(ContentProvider.java:2087)
[AndroidRuntime]    at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45)
[AndroidRuntime]    at android.app.ActivityThread.installProvider(ActivityThread.java:7751)
[AndroidRuntime]    at android.app.ActivityThread.installContentProviders(ActivityThread.java:7296)
[AndroidRuntime]    at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7153)
[AndroidRuntime]    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7121)
[AndroidRuntime]    at android.app.ActivityThread.access$1500(ActivityThread.java:274)
[AndroidRuntime]    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2102)
[AndroidRuntime]    at android.os.Handler.dispatchMessage(Handler.java:107)
[AndroidRuntime]    at android.os.Looper.loop(Looper.java:237)
[AndroidRuntime]    at android.app.ActivityThread.main(ActivityThread.java:8154)
[AndroidRuntime]    at java.lang.reflect.Method.invoke(Native Method)
[AndroidRuntime]    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
[AndroidRuntime]    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
[AndroidRuntime] Caused by: java.lang.ClassNotFoundException: com.google.android.datatransport.runtime.ExecutionModule_ExecutorFactory
[AndroidRuntime]    at java.lang.VMClassLoader.findLoadedClass(Native Method)
[AndroidRuntime]    at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
[AndroidRuntime]    at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
[AndroidRuntime]    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
[AndroidRuntime]    ... 40 more
[AndroidRuntime] Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/datatransport/runtime/dagger/internal/Factory;
[AndroidRuntime]    ... 40 more
[AndroidRuntime] Caused by: java.lang.ClassNotFoundException: com.google.android.datatransport.runtime.dagger.internal.Factory
[AndroidRuntime]    at java.lang.VMClassLoader.findLoadedClass(Native Method)
[AndroidRuntime]    at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
[AndroidRuntime]    at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
[AndroidRuntime]    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
[AndroidRuntime]    ... 40 more
[AndroidRuntime] Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/inject/Provider;
[AndroidRuntime]    ... 40 more
[AndroidRuntime] Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.inject.Provider" on path: DexPathList[[zip file "/data/app/com.taphome.android.next-UA_GiR9v1xnKi34mZZEeCg==/base.apk"],nativeLibraryDirectories=[/data/app/com.taphome.android.next-UA_GiR9v1xnKi34mZZEeCg==/lib/arm, /data/app/com.taphome.android.next-UA_GiR9v1xnKi34mZZEeCg==/base.apk!/lib/armeabi-v7a, /system/lib, /product/lib]]
[AndroidRuntime]    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
[AndroidRuntime]    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
[AndroidRuntime]    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
[AndroidRuntime]    ... 40 more
like image 307
Michal Dobrodenka Avatar asked Feb 05 '21 22:02

Michal Dobrodenka


1 Answers

I had to add "Xamarin.Google.Dagger" NuGet, which is not listed in "Xamarin.Azure.NotificationHubs.Android" dependecies.

like image 138
Michal Dobrodenka Avatar answered Oct 04 '22 20:10

Michal Dobrodenka