Cloud Firestore在APK发布模式下使应用程序崩溃

时间:2019-09-29 18:09:25

标签: flutter dart google-cloud-firestore crash

Flutter Cloud Firestore在我的Flutter应用程序上创建了一个错误,当我在发布模式下在APK上执行该错误时,它只会使该应用程序崩溃并关闭。我有AndroidX,从flutter run --release尝试运行该应用程序时,一切正常,并且已连接设备。我有一个星期的问题了,但找不到解决方法。

首先,我认为这是Google Maps Plugin的问题,但后来我意识到,它在应用程序的其他部分也发生过,我不使用它,但我也使用了cloud_firestore库。所以我认为这有问题

这是我执行flutter build apk时的控制台

Gabriels-MacBook-Pro:Safer jumpbotron$ flutter build apk --release
You are building a fat APK that includes binaries for android-arm, android-arm64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Initializing gradle...                                              1.3s
Resolving dependencies...                                           4.0s
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Note: /Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.9+2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.                    
Note: /Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.9+2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.                      
Note: /Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.3+6/android/src/main/java/io/flutter/plugins/connectivity/ConnectivityPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.                    
Note: /Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.0+6/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.                      
Note: Some input files use unchecked or unsafe operations.              
Note: Recompile with -Xlint:unchecked for details.                      
RRemoved unused resources: Binary resource data reduced from 256KB to 233KB: Removed 8%
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                     117.5s
Built build/app/outputs/apk/release/app-release.apk (7.2MB).

1 个答案:

答案 0 :(得分:0)

我相信以下几行指出了问题所在。

Resolving dependencies...                                           4.0s
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

弃用不是错误,是警告。在这种情况下,警告您该功能最终将被删除。

这是一个已知的XML namespaces,根据这次对话,它已经是issue

您可能还会发现fixed确实很有帮助,因为它可以说明问题的原因。