firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.67k stars 3.97k forks source link

DynamiteModule: Local module descriptor class for providerinstaller not found. #4940

Closed hagans closed 3 years ago

hagans commented 3 years ago

Steps to Reproduce

  1. Create a new Flutter app
  2. Standard link to Firebase android App, no SHA used.
  3. Add google-services.json and firebase integration: at build.gradle:
buildscript {
     .....
    repositories {
        google()
        ......
    }
     ......
    dependencies {
        .......
        classpath 'com.google.gms:google-services:4.3.5'
    }    
}
.....
allprojects {
    repositories {
        google()
        ....
    }
}

and at src/build.gradle:

......
apply plugin: 'com.google.gms.google-services'
.......
dependencies {
   .......
    implementation platform('com.google.firebase:firebase-bom:26.4.0')
    implementation 'com.google.firebase:firebase-analytics-ktx'
}
  1. Add to your pubspec.yaml file the firebase core and auth dependencies:
    firebase_core: ^0.7.0
    firebase_auth: ^0.20.0+1

At this point any code like Firebase.initializeApp() or FirebaseAuth.instance.signInAnonymously() should work fine,

  1. Add Firestore to pubspec.yaml:
    cloud_firestore: ^0.16.0

But... It will be required to active multidex at your build.gradle in order to build.

defaultConfig {
    .........
    multiDexEnabled true
}

After multidex is enabled, errors start to be dropped. You don't need to use clod_firestore, just Firebase.initializeApp() will result in this warning messages, at least for me:

W/DynamiteModule(17125): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(17125): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(17125): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.

And if I try to add some document to any collection:

W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/om.hagans.smok(17125): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
W/System  (17125): Ignoring header X-Firebase-Locale because its value was null.

Still documents are written at the firestore but sometimes (so much times!) apps break while processing any firebase feature.

Here is my flutter doctor:
[√] Flutter (Channel beta, 1.25.0-8.3.pre, on Microsoft Windows [Versión 10.0.18363.1316], locale es-ES)
    • Flutter version 1.25.0-8.3.pre at C:\flutter
    • Framework revision 5d36f2e7f5 (3 weeks ago), 2021-01-14 15:57:49 -0800
    • Engine revision 7a8f8ca02c
    • Dart version 2.12.0 (build 2.12.0-133.7.beta)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\AndroidSDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = C:\AndroidSDK
    • ANDROID_SDK_ROOT = C:\AndroidSDK
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] IntelliJ IDEA Community Edition (version 2020.3)
    • IntelliJ at C:\Users\ruben\AppData\Local\JetBrains\IntelliJ IDEA Community Edition 2020.3.2
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin version 203.6912

[√] VS Code (version 1.52.1)
    • VS Code at C:\Users\ruben\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (4 available)
    • Aquaris C (mobile)                 • CX004705      • android-arm    • Android 8.1.0 (API 27)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 10 (API 29) (emulator)
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 88.0.4324.104
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 88.0.705.56

• No issues found!

And I've updated google services. IS NOT GOOGLE SERVICES ISSUE, at least in this case all started going wrong after enable multidex.

markusaksli-nc commented 3 years ago

Hi @hagans I see there's an open issue addressing the case you described https://github.com/FirebaseExtended/flutterfire/issues/4447. Please follow up on that issue, I'm closing the current one as a duplicate. If you disagree, please write in the comments and I will reopen it. Thank you

hagans commented 3 years ago

Thanks you so much, I didn't saw this thread, posted there :)