Я использую следующий способ добавления multidex
в свой проект, но я сталкиваюсь со следующей ошибкой
Ошибка: тип программы уже присутствует:
android.support.multidex.ZipUtil $ CentralDirectory
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.example.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 3
versionName "1.0.7"
vectorDrawables.useSupportLibrary = true
vectorDrawables {
useSupportLibrary = true
}
multiDexEnabled true
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "12g"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:' + rootProject.ext.supportLibraryVersion
implementation 'com.android.support:support-v4:' + rootProject.ext.supportLibraryVersion
implementation 'com.android.support:design:' + rootProject.ext.supportLibraryVersion
implementation 'com.android.support:cardview-v7:' + rootProject.ext.supportLibraryVersion
implementation 'com.android.support:recyclerview-v7:' + rootProject.ext.supportLibraryVersion
implementation 'dev.dworks.libs:volleyplus:+'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'androidx.multidex:multidex:2.0.0'
......
}
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = []
}
dx.additionalParameters += '--multi-dex' // enable multidex
// optional
dx.additionalParameters += "--main-dex-list=$projectDir/multidex.keep".toString()
}
}
ext {
compileSdkVersion = 28
buildToolsVersion = "28.0.2"
minSdkVersion =19
targetSdkVersion = 28
supportLibraryVersion = '26.0.0-alpha1'
}
multidex.keep
android/support/multidex/BuildConfig/class
android/support/multidex/MultiDex$V14/class
android/support/multidex/MultiDex$V19/class
android/support/multidex/MultiDex$V4/class
android/support/multidex/MultiDex/class
android/support/multidex/MultiDexApplication/class
android/support/multidex/MultiDexExtractor$1/class
android/support/multidex/MultiDexExtractor/class
android/support/multidex/ZipUtil$CentralDirectory/class
android/support/multidex/ZipUtil/class
AppController.java
public class AppController extends Application {
@Override
public void onCreate() {
super.onCreate();
MultiDex.install(this);
}
}
Может кто-нибудь помочь мне
спасибо