2017-11-14 18 views
0

でこんにちは人は、私は次のエラーを取得する:Gradleでは、エラー、エラーの構築:実行は、タスクに失敗しました ':アプリ:transformResourcesWithMergeJavaResForDebug' IAMは私のAndroidアプリを実行しようとしたときのpom.xml

Gradle build error, Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug' com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META/INF/maven/com.squareup.okio/okio/pom.xml

enter image description here

これらは私のGradleファイルの両方です:

// Top-level build file where you can add configuration options common to 
    all sub-projects/modules. 

buildscript { 
repositories { 
    jcenter() 

} 
dependencies { 
    classpath 'com.android.tools.build:gradle:2.1.0' 
    classpath 'com.google.gms:google-services:3.1.0' 
    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
} 
} 

allprojects { 
repositories { 
    jcenter() 
    apply plugin: 'maven' 
    maven { url 'https://maven.google.com' } 
    maven {url 'https://maven.fabric.io/public'} 
} 
} 

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

そして、これが他のいずれかです。

apply plugin: 'com.android.application' 
android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.2" 

    defaultConfig { 
    applicationId "com.dp.liveupdatestatus" 
    minSdkVersion 18 
    targetSdkVersion 26 
    versionCode 1 
    versionName "1.0" 
    } 
    buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 
     'proguard-rules.pro' 
    } 
    } 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
testCompile 'junit:junit:4.12' 

compile 'com.android.support:appcompat-v7:26.1.0' 
compile 'com.android.support:design:26.1.0' 
compile 'com.android.support:recyclerview-v7:26.1.0' 
// This is needed for firebase UI 
compile 'com.android.support:support-v4:26.1.0' 
compile 'com.android.support:customtabs:26.1.0' 
compile 'com.android.support:cardview-v7:26.1.0' 

compile 'com.google.firebase:firebase-core:11.4.2' 
compile 'com.google.firebase:firebase-database:11.4.2' 
compile 'com.google.firebase:firebase-storage:11.4.2' 
compile 'com.google.firebase:firebase-crash:11.4.2' 
compile 'com.google.firebase:firebase-auth:11.4.2' 
compile 'com.google.firebase:firebase-messaging:11.4.2' 
compile 'com.firebaseui:firebase-ui:3.1.0' 
compile 'com.squareup.picasso:picasso:2.5.2' 
} 
// Add to the bottom of the file 
apply plugin: 'com.google.gms.google-services' 

助けてください!

+0

META INFファイルを除外するためにこれを追加 } ' –

+1

https://stackoverflow.com/a/34673607/3395198これがあなたを助けることを願っています –

+1

ありがとう。あなたが望むなら私はそれを正しい解決策として受け入れることができます。ご挨拶! – Pero

答えて

1
android { 
...... 
packagingOptions { 
    exclude 'META-INF/DEPENDENCIES.txt' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/notice.txt' 
    exclude 'META-INF/license.txt' 
    exclude 'META-INF/dependencies.txt' 
    exclude 'META-INF/LGPL2.1' 
} 
} 

この `packagingOptions { は 'META-INF/DEPENDENCIES' が 'META-INF/NOTICE' を除外除外は 'META-INF/LICENSE' を除外する追加

+0

ありがとうございますが、これは問題を解決しませんでした。 – Pero

関連する問題