java - 运行flutter run时出错:无法合并dex
问题描述
我在我的颤振应用程序中使用云火库,现在我收到了这个错误
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
这是我的 gradle.build 文件
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 27
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.datacollectorsecond"
minSdkVersion 21
targetSdkVersion 27
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
configurations.all {
resolutionStrategy {
force 'com.google.android.gms:play-services-places:11.8.0'
force 'com.google.android.gms:play-services-location:11.8.0'
}
}
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation ('com.google.android.gms:play-services-places:11.8.0') {
force = true
}
implementation ('com.google.android.gms:play-services-location:11.8.0') {
force = true
}
}
我收到此错误: 注意:/Users/apple/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5+1/android/src/main/java/io/flutter/ plugins/firebase/core/FirebaseCorePlugin.java 使用未经检查或不安全的操作。注意:使用 -Xlint:unchecked 重新编译以获取详细信息。注意:某些输入文件使用未经检查或不安全的操作。注意:使用 -Xlint:unchecked 重新编译以获取详细信息。
FAILURE:构建失败并出现异常。
- 出了什么问题:任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”执行失败。
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex 一周前工作正常,现在显示错误,但是当我删除 cloud_firesotore 时,它开始工作
解决方案
推荐阅读
- rust - Rust 中的可变借用没有给出错误
- java - 在通过 Java 使用 Selenium 在 VS Code 中工作时,使用 sendKeys 方法的类型 ByJava(67108964) 未定义方法 sendKeys(String)
- java - Gradle:添加子项目的依赖项作为根项目的依赖项
- java - 从同一个类中的另一个方法调用 void 方法
- statistics - 关于 Blue Sky Open Source-x64 的 BlueSky 统计问题
- html - 如何在不同标签之间添加空格
- actions-on-google - 谷歌语音合成
标签未按预期方式工作 - iis - GCP,尽管存在转发规则,但 IIS 上没有外部 IP
- python - 如何使用 python jenkinsapi 模块解析和更新 jenkins 作业 config.xml
- python - 用于多组比较的 Python 中的 T 检验