FirebaseInitProvider class not found in dex file RRS feed

  • Question

  • User391132 posted

    Hi, The android app in "DEBUG" is working fine with all features including but we are facing some issue while releasing the app in play store.

    The issue facing While initialization the app is crashing showing this error Issue: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.mvt.mstntapp-1/base.apk", zip file "/data/app/com.mvt.mstntapp-1/splitconfig.arm64v8a.apk", zip file "/data/app/com.mvt.mstntapp-1/splitconfig.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/com.mvt.mstntapp-1/lib/arm64, /data/app/com.mvt.mstntapp-1/base.apk!/lib/arm64-v8a, /data/app/com.mvt.mstntapp-1/splitconfig.arm64v8a.apk!/lib/arm64-v8a, /data/app/com.mvt.mstntapp-1/splitconfig.xxhdpi.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]

    Which says the com.google.firebase.provider.FirebaseInitProvider is not present in any Dex file. What is the build configuration for Android release We tried several configuration combinations like -

    The Pink highlighted configurations combination is tried differently. The same thing is happening when we enable multidex in debug mode too.

    The tools used.. Visual Studio version 16.3.6(Professional) Xamarin version Xamarin Android SDK Xamarin IOS SDK

    Thursday, December 19, 2019 11:48 AM

All replies

  • User8896 posted

    Disable R8 and use ProGuard. Solved my problem:

    Friday, December 20, 2019 8:55 AM
  • User176749 posted

    @RobSchoenaker said: Disable R8 and use ProGuard. Solved my problem:

    thats not a solution. thats a workaround. R8 is becomin more standard for Android by google and we need to use this option. if it is not production ready, somebody from Xamarin team needs to clarify it.

    Saturday, December 21, 2019 1:28 AM
  • User8896 posted

    Your question was: "What is the build configuration for Android release", so I would opt this for a working 'solution'. That is, for now. I agree that R8 should be usable, but this seems not to be the case just yet.

    Saturday, December 21, 2019 10:35 AM
  • User9505 posted

    We are facing this same issue. Is using ProGuard still the recommended approach? I have tried enabling multidex (at recommendation of some Stack Overflow posts), but it did not work.

    Sorry to bump an old thread, but searching through the forums this seems like the best place.

    Monday, April 5, 2021 12:45 AM
  • User9505 posted

    I was able to resolve from the advice in https://forums.xamarin.com/discussion/comment/275568/#Comment_275568.

    In summary: * Created Proguard configuration for Android project to ensure Firebase classes are not removed from final archive: -dontwarn com.google.android.gms.** -keep class com.google.android.gms.** { *; } -keep class com.google.firebase.** { *; } * Was able to keep using R8 shrinker, as it is backwards compatible and still uses Proguard configuration. My Android build config:

    Hope it helps someone else.

    Sunday, April 11, 2021 8:25 PM