2017-02-21 3 views
0

Googleサービスでアプリを作成しましたが、今度は署名付きapkを生成したいと思います。しかし、私はTransformException複数のdexファイル

Error:Execution failed for task ':app:transformClassesWithDexForRelease'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzqv;

私はこのエラーを取得し、このAPKを作成しようとすると、これは私のGradleは

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 25 
buildToolsVersion "25.0.0" 
defaultConfig { 
    applicationId "com.xxx.xxx.xxx" 
    minSdkVersion 18 
    targetSdkVersion 25 
    versionCode 5 
    versionName "2.0" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 

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

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile 'com.android.support:appcompat-v7:25.1.0' 
compile project(':BaseGameUtils') 
compile 'com.google.android.gms:play-services-ads:10.2.0' 
compile 'com.google.android.gms:play-services-games:10.2.0' 
compile 'com.google.android.gms:play-services-gcm:10.2.0' 
compile 'cn.pedant.sweetalert:library:1.3' 
compile 'com.nineoldandroids:library:2.4.0' 
compile 'com.daimajia.easing:library:[email protected]' 
compile 'com.daimajia.androidanimations:library:[email protected]' 
testCompile 'junit:junit:4.12' 
} 

ファイルである私はstackoverflowのからいくつかのソリューションを試みたが、私のエラーがまだ表示されます。私はあなたたちはbuild.gradleにmultidexを有効

答えて

0

試しに私の問題を解決するために私を助けることができると思います

defaultConfig { 
    ... 
    multiDexEnabled true 
} 

はまた、依存関係を追加します。

あなたのアプリケーションで今
dependencies { 
    compile 'com.android.support:multidex:1.0.0' 
} 

クラス:マルチサイドアタッチメント

public class MyApplication extends Application { 

    @Override 
    protected void attachBaseContext(Context base) { 
     super.attachBaseContext(base); 
     MultiDex.install(this); 
    } 

} 

マニフェストでアプリケーションクラスを定義してください。

+0

ありがとうございました。私はあなたの提案を試みましたが、次のエラーが表示されます: 'エラー:タスク':app:transformClassesWithJarMergingForRelease 'の実行に失敗しました。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重複したエントリ:com/google/android/gms/internal/zzqv.class ' – user5985727

+0

クリーンビルドプロジェクト。このソリューションを試してみる:urは重複したエントリを持っているhttp://stackoverflow.com/questions/26966843/java-util-zip-zipexception-duplicate-entry-during-packagealldebugclassesformult – rafsanahmad007

+0

私のために働いてくれてありがとう – user5985727

関連する問題