2

Google 게임 API를 사용하여 내 안드로이드 게임에 리더 보드를 추가했습니다. 이제 Android Studio의 Firebase '마법사'를 사용하여 배너 광고를 추가하고 싶습니다. 그것은 잘 구축,하지만 난이 APK를 만들려고 할 때, 나는 다음과 같은 오류 얻을 : 마법사를 사용하면Google Base 게임을 Firebase와 함께 사용

Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzqv;

을 내 build.gradle 파일은 다음과 같다 : I 시도

apply plugin: 'com.android.application' 

    android { 
     compileSdkVersion 22 
     buildToolsVersion "22.0.1" 
     defaultConfig { 
     applicationId "xxx" 
     minSdkVersion 15 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.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']) 


     compile project(':BaseGameUtils') 

     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',  { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 

     compile 'com.google.android.gms:play-services-games:10.0.1' 
     compile 'com.google.firebase:firebase-ads:10.0.1' 

     testCompile 'junit:junit:4.12' 
    } 


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

/여러 개의 덱스 파일 문제와 관련된 모든 것을 읽었지만 나에게는 아무런 효과가 없었다. 누구든지 나를위한 힌트를 가지고 있습니까? 리더 보드에도 Firebase를 사용해야합니까? 어떤 도움을/클레이튼 윌킨슨의 의견에 Pettersson이

+0

내가 비슷한 build.gradle 파일을 사용하여 문제를 재현 할 수없는입니다 : –

+1

BaseGameUtils의 gradle 파일을 확인하십시오. 내 생각에 여러 버전의 play-services- *가 포함되어 있습니다. BaseGameUtils는 더 이상 제한된 값을 가지고 있기 때문에 정적 메소드 몇 개를 프로젝트에서 직접 복사 할 수 있습니다. –

답변

1

덕분에 힌트 방법 ...

감사 찾을 수 없습니다, 나는 내 문제를 해결할 수 있습니다. 문제는 BaseGameUtils가 이전 버전의 재생 서비스를 계속 사용하고 있음을 나타냅니다. 올바른 버전이 추가되었으며 현재 작동합니다. 다음 프로젝트에 BaseGameUtils를 생략 할 것입니다.

덕분에 많은

0

물론, 거기에 약간의 충돌이 있습니다 ...하지만, 것은 당신이 일반적인 용어로 이야기하면, 내 말은, 당신이 'com.google.android.gms 컴파일 사용하는 것입니다 : Play의 services : XXX ', 끝났습니다.

buildTypes { 
    release { 
     minifyEnabled true //Here change false to true 
     proguardFiles getDefaultProguardFile('proguard-android-optimize.txt') 
    } 
} 
0

난 그냥 (true로 거짓 변경) 난독 근무 가능 같은 오류가 발생했다. 최상위 (프로젝트) build.gradle을 게시하십시오. 또한 프로젝트의 "깨끗한"작업을 해본 적이 있습니까?