2017-01-20 4 views
-1

내 안드로이드 스튜디오에서 apk 파일을 만들려고하는데 다음과 같은 오류가 발생합니다.내 안드로이드 스튜디오에서 빌드 apk 파일을 생성하는 중 오류가 발생했습니다.

오류 : 'app : transformClassesWithJarMergingForDebug'작업에 대한 실행이 실패했습니다.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/common/api/zzd.class

어떻게이 문제를 해결하고 apk 파일을 만드십시오.

Mygradle 파일의 코드는 다음과 같습니다

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 24 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.wedding.weddingapp" 
     minSdkVersion 16 
     targetSdkVersion 24 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     multiDexEnabled true 
     configurations { all*.exclude module: 'gson-2.5' } 
    } 

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


repositories { 
    maven { url "https://raw.githubusercontent.com/layerhq/releases-android/master/releases/" } 
    maven { url "https://raw.githubusercontent.com/layerhq/Atlas-Android/master/releases/" } 
} 
dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 

    }) 

    compile 'com.layer.atlas:layer-atlas:0.3.6' 
    compile 'com.google.firebase:firebase-messaging:9.8.0' 
    compile 'com.android.support:appcompat-v7:24.2.1' 
    compile 'com.android.support:design:24.2.1' 
    compile 'com.android.volley:volley:1.0.0' 
    compile 'de.hdodenhof:circleimageview:2.1.0' 
    compile 'com.android.support:support-v4:24.2.1' 
    testCompile 'junit:junit:4.12' 
} 

// ADD THIS AT THE BOTTOM 
apply plugin: 'com.google.gms.google-services' 
+0

프로젝트를 청소 한 다음 서명 된 apk를 다시 생성하면 도움이 될 수 있습니다. –

+0

'compile'com.google.firebase : firebase-messaging : 10.0.1'' –

+0

'compileSdkVersion' 및'targ etSdkVersion' * 25 *. 그런 다음 'appcompat-v7 : 25.1.0' –

답변

0

그것을 아마 당신이 구글에서 서비스의 이전 버전을 사용해야하기 때문에 apply plugin: 'com.google.gms.google-services'com.google.firebase:firebase-messaging:9.8.0은 당신이 사용을 확인하시기 바랍니다 com.google.gms.google-services 9.0.0를 사용하지 않는 호환 참고 있는지 확인하십시오 9.0.0 버전 이상

관련 문제