logcat的输出后:越来越Multidex错误android原生增加火力
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工具,但仍然无法工作。
检查这个答案它可以帮助你我的朋友https://stackoverflow.com/questions/44603154/how-to-fix-android-4-4-2-error-classnotfoundexception-didnt-find-class-com-去/ 44603205#44603205 –
仍然不能正常工作 – user3606902