問題描述
- Error: Program type already present:okio.AsyncTimeout;
- Error: Program type already present: rx.android.BuildConfig;
- Error: Program type already present: okio.Buffer$1;
- Error: Program type already present: okhttp3.Authenticator$1;
- Error: Program type already present: rx.android.BuildConfig;
解決方案
1、`
android {
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/rxandroid.properties'
}
}
2、
defaultConfig {
multiDexEnabled true
}
3、`
dependencies {
configurations {
/*all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
all*.exclude group: 'com.squareup.okio'*/
all*.exclude group: 'com.squareup.okhttp3'
all*.exclude group: 'com.squareup.okio'
}
}
4、調整jar引用的先後順序。
gradlew -q app:dependencies