Flutter 应用程序错误:任务 ':app:mergeExtDexDebug' 执行失败

时间:2021-01-06 16:33:34

标签: flutter flutter-layout flutter-dependencies

我有这个错误,它让我很困惑,我不知道问题到底出在哪里???

FAILURE:构建失败,出现异常。

  • 出了什么问题: 任务“:app:mergeExtDexDebug”执行失败。
<块引用>

无法解析配置“:app:debugRuntimeClasspath”的所有文件。 无法转换x86_debug-1.0.0-ae90085a8437c0ae94d6b5ad2741739ebc742cb4.jar(io.flutter:x86_debug:1.0.0-ae90085a8437c0ae94d6b5ad2741739ebc742cb4)来匹配属性{artifactType =机器人-DEX,德兴启用-脱糖=真,德兴-是-可调试=真, dexing-min-sdk=21, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}。 > DexingWithClasspathTransform 执行失败:C:\Users\YazidRashed.gradle\caches\transforms-2\files-2.1\0d02e2147bd49ecb8b09c977702a7363\jetified-x86_debug-1.0.0-ae894d74bc7ae84d74b4ae84d74b4ae84d78c7a84d78c7a904d > 无法解析结果路径字符串:
无法转换x86_64_debug-1.0.0-ae90085a8437c0ae94d6b5ad2741739ebc742cb4.jar(io.flutter:x86_64_debug:1.0.0-ae90085a8437c0ae94d6b5ad2741739ebc742cb4)来匹配属性{artifactType =机器人-DEX,德兴启用-脱糖=真,德兴-是-可调试=真, dexing-min-sdk=21, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}。 > DexingWithClasspathTransform 执行失败:C:\Users\YazidRashed.gradle\caches\transforms-2\files-2.1\ed811ace11d0099caa1c8aacd56e7b41\jetified-x86_64_debug-1.0.0-ae894dc74ae94dc75c75ac75c75ac75ac70875 > 无法解析结果路径字符串:

  • 试试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。

  • https://help.gradle.org

    获得更多帮助

在 16m 6s 内构建失败 例外:Gradle 任务 assembleDebug 失败,退出代码为 1

app\build.gradle 如下:

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 = '14'
}
// CCV 2.1 = 14
// CCV 2.0 = 13
// CCV 1.9 = 12
// CCV 1.8 = 11
// CCV 1.7 = 10
// CCV 1.6 = 9
// CCV 1.5 = 8
// CCV 1.5 = 7
// CCV 1.4 = 6
// CCV 1.3 = 5
// CCV 1.3 = 4
// CCV 1.2 = 3
// CCV 1.1 = 2
// CCV 1.0 = 1

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '2.1.0'
}
// CCV 2.1 = 2.1.0
// CCV 2.0 = 2.0.0
// CCV 1.9 = 1.9.0
// CCV 1.8 = 1.8.0
// CCV 1.7 = 1.7.0
// CCV 1.6 = 1.6.0
// CCV 1.5 = 1.5.0
// CCV 1.4 = 1.4.1
// CCV 1.4 = 1.4.0
// CCV 1.3 = 1.3.1
// CCV 1.3 = 1.3.0
// CCV 1.2 = 1.2.0
// CCV 1.1 = 1.1.0
// CCV 1.0 = 1.0.0

def keystoreProperties = new Properties()
   def keystorePropertiesFile = rootProject.file('key.properties')
   if (keystorePropertiesFile.exists()) {
       keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
   }

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 29

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.panaceasoft.flutterbuyandsell"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

     signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }
    
   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

            minifyEnabled true
            useProguard true

            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    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.firebase:firebase-core:17.3.0'
    implementation 'com.google.firebase:firebase-messaging:20.1.5'
    implementation 'com.android.support:multidex:1.0.3'
   
}

apply plugin: 'com.google.gms.google-services'

android\build.gradle 是:

buildscript {
    repositories {
        jcenter()
        google()

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.3'
        classpath "com.google.gms:google-services:4.3.3"
    }
}

allprojects {
    repositories {
        jcenter()
        google()

    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

// subprojects {
//     project.configurations.all {
//         resolutionStrategy.eachDependency { details ->
//            if (details.requested.group == 'androidx.core'
//                     && !details.requested.name.contains('androidx') ) {
//                 details.useVersion "1.0.1"
//             }
//         }
//     }
// }

task clean(type: Delete) {
    delete rootProject.buildDir
}

颤振医生:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.19041.685], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[!] Android Studio (version 4.1.0)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Community Edition (version 2018.3)
    X Flutter plugin not installed; this adds Flutter specific functionality.
[√] VS Code (version 1.52.1)
[√] Connected device (1 available)

! Doctor found issues in 2 categories.

0 个答案:

没有答案