Flutter Error: java.lang.NoSuchFieldError PREFER_HIGHEST_OR_REMOTE_VERSION_NO_FORCE_STAGING

后端 未结 3 1565
予麋鹿
予麋鹿 2020-12-30 18:07

I have tried to solve this problem but it keeps giving me the same error.

I use the following firebase services:

  • Firebase Auth
  • Firebase Databa
3条回答
  •  难免孤独
    2020-12-30 18:28

    I believe that this is due to the fact that half of Google's FlutterFire plugins are using old versions of their Android counterparts. As such, I've specified which versions to use in my app level build.gradle. This probably isn't a permanent solution, but seems to have stopped the crashes in the mean time.

    In the app level build.gradle, add the following to dependencies:

    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-analytics:16.0.4'
    implementation 'com.google.firebase:firebase-auth:16.0.4'
    implementation 'com.google.firebase:firebase-firestore:17.1.1'
    implementation 'com.google.firebase:firebase-functions:16.1.1'
    implementation 'com.google.firebase:firebase-messaging:17.3.3'
    implementation 'com.google.firebase:firebase-storage:16.0.3'
    

    Let me know if this works.

    Edit: Only add the implementation lines for the Firebase plugins that you are using. You can find the latest version of each here.

提交回复
热议问题