【发布时间】:2020-01-29 03:49:45
【问题描述】:
Flutter Cloud Firestore 在我的 Flutter 应用程序上创建一个错误,当我在发布模式下的 APK 上执行它时,它只会使应用程序崩溃并关闭它。我有 AndroidX,当我从 flutter run --release 尝试应用程序并且我连接了我的设备时,一切正常。我有这个问题一周了,我还没有找到解决方法。
首先我认为这是谷歌地图插件的问题,但后来我意识到它也发生在我不使用它但我也使用 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).
【问题讨论】:
-
是的,但它是构建的。你能提供一个堆栈跟踪吗?
-
正如我告诉你的,在调试模式下一切正常,当我制作构建 apk 并安装它时,问题就出现了,它根本不起作用
-
你试过
flutter run --release吗? -
它与 Flutter run 配合得很好 --release 问题是当我创建一个 apk 文件时,当我从中执行应用程序时它会崩溃
标签: flutter dart google-cloud-firestore crash