2017-10-07 6 views
0
나는 다음과 같은 오류에 직면하고있어

:com.android.build.api.transform.TransformException : java.lang.IllegalStateException

Error:Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'. 
> com.android.build.api.transform.TransformException: java.lang.IllegalStateException 

내 앱 build.gradle :

apply plugin: 'com.android.application' 
apply plugin: 'com.google.firebase.firebase-perf' 

android { 
    compileSdkVersion 26 
    buildToolsVersion '26.0.2' 

    defaultConfig { 
     applicationId "ahija.com" 
     minSdkVersion 19 
     targetSdkVersion 26 
     versionCode 24 
     versionName "2.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     vectorDrawables.useSupportLibrary = true 
     multiDexEnabled true 
    } 

    configurations.all { 
//  resolutionStrategy.eachDependency { DependencyResolveDetails details -> 
//   def requested = details.requested 
//   if (requested.group == 'com.android.support') { 
//    if (!requested.name.startsWith("multidex")) { 
//     details.useVersion '26.1.0' 
//    } 
//   } 
//  } 
    } 

    dexOptions { 
     javaMaxHeapSize "4g" 
    } 

    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_8 
     targetCompatibility JavaVersion.VERSION_1_8 
    } 

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

    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' 
    } 

} 

dependencies { 
    implementation 'com.android.support:support-v4:26.1.0' 
    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' 
// }) 

    // GOOGLE 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:appcompat-v7:26.1.0' 
    compile 'com.android.support:recyclerview-v7:26.1.0' 
    compile 'com.android.support:design:26.1.0' 
    compile 'com.android.support:support-vector-drawable:26.1.0' 
    compile 'com.android.support:cardview-v7:26.1.0' 
    compile 'com.android.support:support-v13:26.1.0' 
    compile 'com.android.support:customtabs:26.1.0' 
    compile 'com.android.support:multidex:1.0.2' 
    compile 'com.google.code.gson:gson:2.8.1' 

    // PLAY SERVICES 
    compile 'com.google.android.gms:play-services-auth:11.4.2' 
    compile 'com.google.android.gms:play-services-maps:11.4.2' 
    compile 'com.google.android.gms:play-services-location:11.4.2' 

    // FIREBASE 
    compile 'com.google.firebase:firebase-messaging:11.4.2' 
    compile 'com.google.firebase:firebase-core:11.4.2' 
    compile 'com.google.firebase:firebase-auth:11.4.2' 
    compile 'com.google.firebase:firebase-database:11.4.2' 
    compile 'com.google.firebase:firebase-crash:11.4.2' 
    compile 'com.google.firebase:firebase-perf:11.4.2' 
    compile 'com.firebaseui:firebase-ui-database:3.0.0' 

    // FACEBOOK 
    compile 'com.facebook.android:facebook-android-sdk:4.26.0' 

    // OTHERS 
    compile 'de.hdodenhof:circleimageview:2.1.0' 
    compile 'com.squareup:android-times-square:[email protected]' 
    compile 'com.daimajia.easing:library:[email protected]' 
    compile 'com.daimajia.androidanimations:library:[email protected]' 
    compile 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.1-rc1' 
    compile 'com.github.zurche:open-weather-map-android-wrapper:v0.1' 
    compile 'com.github.varunest:sparkbutton:1.0.5' 
    compile 'com.nineoldandroids:library:2.4.0' 
    compile 'com.daimajia.slider:library:[email protected]' 
    compile 'de.cketti.mailto:email-intent-builder:1.0.0' 
    compile 'id.zelory:compressor:2.1.0' 
    compile 'com.github.jrvansuita:PickImage:2.1.4' 
    compile 'com.github.DamanSingh4321:ProProgressViews:v1.1' 
    compile group: 'com.cloudinary', name: 'cloudinary-android', version: '1.20.0' 

    // INTEGRATIONS 
    compile 'com.github.freshdesk:hotline-android:1.2.5' 

    // NEW AND COOL 
    compile 'com.jakewharton.timber:timber:4.5.1' 
    compile 'com.jakewharton:butterknife:8.8.1' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.squareup.okhttp3:okhttp:3.9.0' 
// compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0' 
// compile 'com.squareup.okhttp3:logging-interceptor:3.9.0' 

    // ANNOTATION PROCESSORS 
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' 
// annotationProcessor 'com.google.dagger:dagger-android-processor:2.11' 

    // TEST 
// testCompile 'junit:junit:4.12' 
} 
apply plugin: 'com.google.gms.google-services' 

앱을 빌드하려고하면 앱이 제대로 빌드되고 APK가 표시되지만 내 기기에서 직접 Android Studio에서 실행하려고하면 위의 오류가 발생합니다. 어떻게 고칠 수 있습니까?

오랫동안이 오류가 발생했습니다. 현재 APK를 수동으로 빌드 한 다음 전화로 전송하여 디버그 버전으로 테스트 중입니다. "실행"버튼을 누르면 위의 오류가 발생합니다.

답변

0

Firebase/Google Play ServiceFirebaseUI입니다 의존성에 호환성 문제가 있기 때문입니다 응용 프로그램 태그

android:name="android.support.multidex.MultiDexApplication" 
+0

전혀 도움 안됨 –

0

매니페스트에 추가합니다. FirebaseUI documentation에서 다음과 같은 메모를 볼 수 있습니다

Each version of FirebaseUI has dependency on a fixed version of these libraries, defined as the variable firebase_version in common/constants.gradle. If you are using any dependencies in your app of the form compile 'com.google.firebase:firebase-:x.y.z' or compile 'com.google.android.gms:play-services-:x.y.z' you need to make sure that you use the same version that your chosen version of FirebaseUI requires.

For convenience, here are some recent examples:

+--------------------+--------------------------------+ 
| FirebaseUI Version | Firebase/Play Services Version | 
+--------------------+--------------------------------+ 
|    3.0.0 | 11.4.2       | 
|    2.4.0 | 11.4.0       | 
|    2.3.0 | 11.0.4       | 
|    2.2.0 | 11.0.4       | 
|    2.1.1 | 11.0.2       | 
|    2.0.1 | 11.0.1       | 
|    1.2.0 | 10.2.0       | 
|    1.1.1 | 10.0.0 or 10.0.1    | 
|    1.0.0 | 9.8.0       | 
+--------------------+--------------------------------+ 

당신이 FirebaseUI 2.4.0 사용할 필요가 11.4.0 당신은 중포 기지/재생 서비스를 사용하기 때문에 :

compile 'com.firebaseui:firebase-ui-database:2.4.0' 

FirebaseUI 문제에서 같은 문제에 대해 자세히 알아보기 : UI incompatibility with other Firebase libs is not warned in documentation

+0

나는 이것을했지만 도움이되지 못했다. 내 업데이트 된 gradle 코드 –

+0

보기'classpath 'com.google.firebase : firebase-plugins : 1.1.1''을 추가 했습니까? –

+0

이미 프로젝트 gradle 파일에 있습니다. –