(重复的jar条目[android / support / v 4 / media / MediaBrowserCompat $ a.class]))

时间:2019-02-20 08:26:16

标签: java android gradle flutter

当我尝试执行“ flutter build apk”时出现以下错误。

  

警告:处理任务java.io.IO时发生异常:不能   写   [C:\ Users \ AndroidStudioProjects \ flutter_project \ build \ app \ intermediates \ transforms \ proguard \ release \ 0.jar]   (不会读   [C:\ Users.gradle \ caches \ transforms-1 \ files-1.1 \ media-1.0.0.aar \ 7e094adc751ccc61de6e32709d240e2d \ jars \ classes.jar(;;;;;; **。class)]   (重复的jar条目[android / support / v   4 / media / MediaBrowserCompat $ a.class]))线程(任务限制器_1):   破坏

这是mygradle文件:

    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'
}

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 28

    lintOptions {
        disable 'InvalidPackage'
    }

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

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    configurations.all {
        resolutionStrategy.force 'com.android.support:support-compat:27.1.1'
        resolutionStrategy.force 'com.android.support:appcompat-v7:27.1.1'
        resolutionStrategy.force 'com.android.support:support-v4:27.1.1'
        resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'


    }
}

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.firebaseui:firebase-ui-database:3.1.1' */// No trouble in compiling
    implementation 'com.google.firebase:firebase-core:16.0.0'
   /* implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.google.firebase:firebase-auth:16.0.1'*/
    implementation "android.arch.core:runtime:1.1.1"
    implementation "android.arch.core:common:1.1.1"
    implementation 'com.android.support:multidex:1.0.3'

}

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

有人可以指出这里有什么问题吗?

0 个答案:

没有答案