2017-01-06 7 views
2

私はこれに無駄な時間を費やしましたが、たくさんのSO投稿を読みましたが、解決策を見つけることができません。私が署名したAPKを生成するとき、私は無駄に、重複何ができるか見るために別のJARのを取り除く試した

Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/util/ThreadUtil$BackgroundCallback.class

得続けます。 android-support-v7-recyclerview-23.1.1.jarは、私の犯人のように思っていたので、削除してもエラーは発生しませんでした。しかし、代わりに、私のアプリは、生成に時間がかかり始め、CPU使用率は350%になり、その後、 "OutOfMemory"例外を使ってグランドルがタイムアウトします。

これは私のbuild.gradleファイルです。

apply plugin: 'com.android.application' 
repositories { 
    mavenCentral() 
    maven(){ 
     url "https://oss.sonatype.org/content/repositories/snapshots" 
    } 
    flatDir { 
     dirs 'libs' 
    } 
} 

android { 
    compileSdkVersion 25 
    buildToolsVersion "23.0.3" 

    defaultConfig { 
     applicationId "com.me.myapp" 
     minSdkVersion 13 
     targetSdkVersion 25 
     multiDexEnabled true 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } 
} 

dependencies { 
    compile 'com.android.support:support-v4:25.1.0' 
    compile 'com.google.android.gms:play-services-analytics:10.0.1' 
    compile 'com.android.support:appcompat-v7:25.1.0' 
    compile 'com.google.android.gms:play-services-ads:10.0.1' 
    compile 'com.google.android.gms:play-services-location:10.0.1' 
    compile files('libs/android-support-v7-recyclerview-23.1.1.jar') 
    compile files('libs/applovin-6.3.0.jar') 
    compile files('libs/appodeal-1.15.8.jar') 
    compile files('libs/chartboost-6.5.1.jar') 
    compile files('libs/flurry-analytics-6.5.0.jar') 
    compile files('libs/google-http-client-1.19.0.jar') 
    compile files('libs/google-http-client-android-1.19.0.jar') 
    compile files('libs/google-http-client-gson-1.19.0.jar') 
    compile files('libs/google-http-client-jackson2-1.19.0.jar') 
    compile files('libs/gson-2.1.jar') 
    compile files('libs/guava-18.0.jar') 
    compile files('libs/jackson-core-2.1.3.jar') 
    compile files('libs/java-api-core-2.10.10.jar') 
    compile files('libs/kinvey-android-2.10.10.jar') 
    compile files('libs/my-target-4.5.10.jar') 
    compile files('libs/unity-ads-2.0.4.jar') 
    compile files('libs/yandex-metrica-2.51.jar') 
    compile project(':cheetah-mobile-3.4.7') 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.github.dexafree:materiallist:3.2.1' 
    compile 'jp.wasabeef:recyclerview-animators:2.0.1' 
    compile ('com.github.worker8:tourguide:[email protected]'){ 
     transitive=true 
    } 
} 
apply plugin: 'com.google.gms.google-services' 

ありがとうございます!

答えて

0

私はとても幸せです!それは最終的に修正されました!

私のgradleから 'libs/android-support-v7-recyclerview-23.1.1.jar'を削除し、build.gradleの "android"囲みに以下の行を追加しました。

dexOptions { 
    javaMaxHeapSize "4g" 
} 

私はthis postから答えを得ました。

関連する問題