gpt4 book ai didi

如果我包含某个包,Flutter android 应用程序会在启动时崩溃

转载 作者:IT王子 更新时间:2023-10-29 06:35:53 25 4
gpt4 key购买 nike

最近突然出现了一个问题,只需在 pubspec.yaml 的“位置”中包含依赖项,例如

dependencies:
flutter:
sdk: flutter

location: ^1.2.0 <------------------------ culprit
firebase_auth: ^0.5.10
cloud_firestore: ^0.7.2

the app crashes immediately upon startup.

'location' 包本身在示例应用程序中单独工作。我目前没有导入,即使用位置包中包含的任何功能,但是当我删除该条目时,一切都很好。

不幸的是,看 flutter log 没有任何线索......

最佳答案

我遇到了同样的问题。我所做的是在我的应用程序的 build.gradle 中插入 multiDexEnabled true 行。像这样:

    defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

multiDexEnabled true //Insert this line
}

试试这个并运行命令 flutter cleanflutter build apkflutter run。它一定能解决您的问题。

关于如果我包含某个包,Flutter android 应用程序会在启动时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50454656/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com