Xamarin.Android 升级 Xamarin.Azure.NotificationHubs.Android v1.1.4.1 后应用程序在使用 Firebase 启动时崩溃
Xamarin.Android App crash on start with Firebase after upgrading Xamarin.Azure.NotificationHubs.Android v1.1.4.1
在我的应用程序中将 Xamarin.Azure.NotificationHubs.Android Nuget 从古老的 0.6 升级到 1.1.4.1(这还涉及从支持库升级到 AndroidX)之后 - 没有 Azure Notification Hub 和 FireBase Nugets(以及注释代码使用它们)。使用这些 Azure/FCM NuGets 我在启动 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[=12=](TransportRegistrar.java:37)
[AndroidRuntime] at com.google.firebase.datatransport.TransportRegistrar$$Lambda.create(Unknown Source:0)
[AndroidRuntime] at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents[=12=](ComponentRuntime.java:132)
[AndroidRuntime] at com.google.firebase.components.ComponentRuntime$$Lambda.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[=12=]$FirebaseMessagingRegistrar(Unknown Source:43)
[AndroidRuntime] at com.google.firebase.messaging.FirebaseMessagingRegistrar$$Lambda[=12=].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[=12=](ComponentRuntime.java:132)
[AndroidRuntime] at com.google.firebase.components.ComponentRuntime$$Lambda.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.access00(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
我必须添加“Xamarin.Google.Dagger”NuGet,它未在“Xamarin.Azure.NotificationHubs.Android”依赖项中列出。
在我的应用程序中将 Xamarin.Azure.NotificationHubs.Android Nuget 从古老的 0.6 升级到 1.1.4.1(这还涉及从支持库升级到 AndroidX)之后 - 没有 Azure Notification Hub 和 FireBase Nugets(以及注释代码使用它们)。使用这些 Azure/FCM NuGets 我在启动 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[=12=](TransportRegistrar.java:37)
[AndroidRuntime] at com.google.firebase.datatransport.TransportRegistrar$$Lambda.create(Unknown Source:0)
[AndroidRuntime] at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents[=12=](ComponentRuntime.java:132)
[AndroidRuntime] at com.google.firebase.components.ComponentRuntime$$Lambda.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[=12=]$FirebaseMessagingRegistrar(Unknown Source:43)
[AndroidRuntime] at com.google.firebase.messaging.FirebaseMessagingRegistrar$$Lambda[=12=].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[=12=](ComponentRuntime.java:132)
[AndroidRuntime] at com.google.firebase.components.ComponentRuntime$$Lambda.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.access00(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
我必须添加“Xamarin.Google.Dagger”NuGet,它未在“Xamarin.Azure.NotificationHubs.Android”依赖项中列出。