2017-08-16 6 views
0

Logcatの出力を追加した後Multidexエラーネイティブアンドロイドを取得:ここはfirebase

Error:Error converting bytecode to dex: 
    Cause: com.android.dex.DexException: Multiple dex files define 
    Lcom/google/firebase/iid/zzc; 

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

com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lcom/google/firebase/iid/zzc; 

は私のbuild.Gradleファイルです:

apply plugin: 'com.android.application' 
buildscript { 
repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 

dependencies { 
    classpath 'io.fabric.tools:gradle:1.+' 
} 
} 

apply plugin: 'io.fabric' 
android { 

} 

useLibrary 'org.apache.http.legacy' 

compileSdkVersion 25 
buildToolsVersion "25.0.2" 

defaultConfig { 
    applicationId "app.test.test” 
    minSdkVersion 15 
    targetSdkVersion 23 

    versionCode 101 
    versionName “1.2.5” 

    multiDexEnabled true 

    resConfigs "en" 
} 

dataBinding { 
    enabled true 
} 

sourceSets { 
    main { 
     manifest.srcFile 'src/main/AndroidManifest.xml' 
     res.srcDirs = ['src/main/res'] 
     assets.srcDirs = ['src/main/assets'] 
    } 
    main.java.srcDirs += 'src/main/java/' 
    debug.setRoot('build-types/debug') 
    release.setRoot('build-types/release') 
} 

    android { 
    dexOptions { 
     javaMaxHeapSize "4g" 
     preDexLibraries true 
     maxProcessCount 8 
    } 

    aaptOptions { 
     cruncherEnabled false 
    } 
} 

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

    debug { 
     debuggable true 
     signingConfig signingConfigs.app_release 
    } 
} 

productFlavors { 
    production { 
     minSdkVersion 15 
     applicationId "app.test.test" 
     resValue "string", "app_name", "test" 
     resValue "string", "content_authority", "app.test.test.sync.StubContentProvider" 
     resValue "string", "account_type", "test.com" 
     dimension "mode" 
    } 

configurations { 
    all*.exclude module: 'gson' 
} 
} 

repositories { 
def androidHome = System.getenv("ANDROID_HOME") 
mavenCentral() 

maven { url "$androidHome/extras/android/m2repository/" } 

maven { url "https://repo.commonsware.com.s3.amazonaws.com" } 

maven { url "https://raw.githubusercontent.com/layerhq/releases-android/master/releases/" } 

maven { url 'https://maven.fabric.io/public' } 

maven { url 'https://s3-ap-southeast-1.amazonaws.com/jp-build-packages/ec-android-sdk' } 

maven { url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/" } 

maven { url "https://jitpack.io" } 

maven { url "https://s3.amazonaws.com/repo.commonsware.com" } 

maven { 
    url 'https://maven.google.com' 
} 
} 

dependencies { 
provided fileTree(include: ['*.jar'], dir: 'libs') 
annotationProcessor files('libs/butterknife-6.1.0.jar') 
implementation files('libs/butterknife-6.1.0.jar') 
implementation files('libs/retrofit-1.9.0.jar') 

// segment - analyti 

//crashlytics 
implementation('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
    transitive = true 
} 

implementation 'com.android.support:appcompat-v7:25.2.0' 
implementation 'com.android.support:recyclerview-v7:25.2.0' 
implementation 'com.android.support:cardview-v7:25.2.0' 
implementation 'com.android.support:support-v4:25.2.0' 
implementation 'com.android.support:design:25.2.0' 
//multidex lib 
implementation 'com.android.support:multidex:1.0.1' 
implementation 'de.greenrobot:eventbus:2.4.0' 
implementation 'com.facebook.android:facebook-android-sdk:[4,5)' 
implementation 'com.felipecsl:gifimageview:1.1.0' 
implementation 'com.squareup.okhttp:okhttp:2.3.0' 
implementation 'fr.avianey.com.viewpagerindicator:library:[email protected]' 
implementation 'net.the4thdimension:poly-picker:1.0.11' 
implementation 'com.navercorp.pulltorefresh:library:[email protected]' 
implementation 'com.nineoldandroids:library:2.4.0' 
implementation 'com.getbase:floatingactionbutton:1.10.0' 
//play service 
implementation ('com.google.firebase:firebase-core:10.2.4'){ 
    exclude group: 'com.google.android.gms' 
} 
implementation ('com.google.firebase:firebase-messaging:10.2.4'){ 
    exclude group: 'com.google.android.gms' 
} 
implementation ('com.google.firebase:firebase-appindexing:10.2.4'){ 
    exclude group: 'com.google.android.gms' 
} 
implementation ('com.google.firebase:firebase-crash:10.2.4'){ 
    exclude group: 'com.google.android.gms' 
} 

implementation 'com.google.android.gms:play-services-plus:10.2.4' 
implementation 'com.google.android.gms:play-services-location:10.2.4' 
implementation 'com.google.android.gms:play-services-gcm:10.2.4' 
implementation 'com.google.android.gms:play-services-auth:10.2.4' 
implementation 'com.google.android.gms:play-services- 
analytics:10.2.4' 

implementation project(':PlaceAutoComplete') 
implementation files('libs/gson-2.8.0.jar') 
implementation 'com.oguzdev:CircularFloatingActionMenu:1.0.2' 
} 
apply plugin: "com.google.gms.google-services" 

私はそれが突然、そこに多くのライブラリがあるが、それは正常に動作していた知っています複数のdexのエラーを私に投げつける。私は自分のSdkプラットフォームとSdkツールを更新しましたが、まだ動作していません。

私は多くのライブラリがあることを知っていますが、正常に動作していました。突然、複数のdexのエラーを投げます。私は自分のSdkプラットフォームとSdkツールを更新しましたが、まだ動作していません。

私は多くのライブラリがあることを知っていますが、正常に動作していました。突然、複数のdexのエラーを投げます。私は自分のSdkプラットフォームとSdkツールを更新しましたが、まだ動作していません。

+0

これをチェックすると、私の友人に役立つかもしれません。https://stackoverflow.com/questions/44603154/how-to-fix-android-4-4-2-error-classnotfoundexception-didnt-find-class-com- go/44603205#44603205 –

+0

まだ動作していません – user3606902

答えて

2

の設定には、次のようmultidex:アプリケーションのクラスを追加するには、マニフェストファイルに今

public class MultiDexApp extends Application { 
    @Override 
    protected void attachBaseContext(Context base) { 
     super.attachBaseContext(base); 
     MultiDex.install(this); 
    } 
} 

android {  
    defaultConfig { 
     // Enable multidex support for android versions grater than API 21 
     multiDexEnabled true 
    } 
} 

dependencies { 
    // Enable multidex support for android versions lower than API 21 
    compile 'com.android.support:multidex:1.0.0' 
} 

は、API 21より低いアンドロイドバージョンについては、次のようにApplicationクラスを拡張:

<application 
    android:name=".MultiDexApp" <!-- enable application class --> 
    android:allowBackup="true" 
    android:icon="@drawable/logo" 
    android:label="@string/app_name" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 

注:プロジェクトがminSdkVersion 20以下のマルチデックスに設定されていて、Android 4.4(APIレベル20)以下のターゲットデバイスにデプロイすると、Androidスタジオはインスタント実行を無効にします。

詳細はlinkです。

+0

まだ動作していません – user3606902

+0

@ user3606902あなたが今直面しているエラー –

+0

このアプリケーションを実行しているAndroidバージョン –