Не удалось выполнить задачу ': app: lintVitalRelease' из-за `Не удалось найти multidex-instrumentation.aar`

1

Когда я пытаюсь синхронизировать модуль приложения внутри Android Studio, появляется сообщение об ошибке:

ОШИБКА: не удалось разрешить: Multidex-Instrumentation Затронутые модули: приложение

Когда я пытаюсь запустить gradlew assemble

Не удалось выполнить задачу ': app: lintVitalRelease'.

Не удалось разрешить все артефакты для конфигурации ': app: debugAndroidTestRuntimeClasspath'. Не удалось найти multidex-instrumentation.aar(androidx.multidex: multidex-instrumentation: 2.0.0). Поиск производился в следующих местах: https://dl.google.com/dl/android/maven2/androidx/multidex/multidex-instrumentation/2.0.0/multidex-instrumentation-2.0.0.aar.

Решения, перечисленные в этом вопросе, не устранили мою проблему. И странно то, что ничего как multidex-instrumentation-2.0.0 не существует, и я не знаю, почему мое приложение ищет такую зависимость. Multidex-Instrumentation 2.0.0 существует в репозитории Maven.

Вот мои build.gradle и app.gradle:

app.gradle

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

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    google()
    jcenter()
    maven {
        url "https://maven.google.com"
    }

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

android {
//    flavorDimensions ("resrouce")
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    lintOptions{
        disable 'MissingTranslation'
//        checkReleaseBuilds false
//        abortOnError false
    }

    defaultConfig {
        applicationId 'com.myapp.android'
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName '1.0'
        multiDexEnabled true
        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath true
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField "boolean", "enableCrashlytics", "true"
            ext.enableCrashlytics = true

        }
        releaseNonObfuscated {
            minifyEnabled false
            debuggable true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-rules-debug.pro'
            buildConfigField "boolean", "enableCrashlytics", "true"
            ext.enableCrashlytics = false

        }



        debug {
            versionNameSuffix '-DEBUG'
            debuggable true
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField "boolean", "enableCrashlytics", "true"
            ext.enableCrashlytics = true
        }
    }
    dexOptions {
        javaMaxHeapSize "2g"
    }
    sourceSets {
        main {
            res.srcDirs = [
                    'src/main/res',
                    'src/main/res/layout',
                    'src/main/res/layouts/product',
                    'src/myapp_eve/res'
            ]

        }

    }
    productFlavors {
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    configurations {
        all*.exclude group: 'com.google.guava', module: 'listenablefuture'
    }
}

ext {
    //support_library_version = '28.0.0'
    smooch_chat_librar_version = '5.16.3'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //implementation 'com.android.support:28.0.0'
    //    implementation 'com.android.support:support-fragment:28.0.0'
//    implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
    //    implementation 'com.android.support:collections:28.0.0'
    //    implementation 'com.android.support:versionedparcelable:28.0.0'
    //    implementation 'com.android.support:collections:28.0.0'
    //    implementation 'de.greenrobot:eventbus:2.4.0'
    //    implementation 'org.roboguice:roboguice:3.0.1'
    //    compileOnly 'org.roboguice:roboblender:4.0.0'
    //    annotationProcessor 'org.roboguice:roboblender:4.0.0'
    //    implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
    //    compile 'com.paypal.sdk:paypal-android-sdk:2.12.4'
    //    compile 'com.braintreepayments.api:braintree:2.3.9'
    //    compile 'com.braintreepayments.api:drop-in:2.3.8'
    //    implementation 'com.facebook.android:facebook-android-sdk:4.23.+'
    //implementation 'org.roboguice:roboblender:4.0.0'
    //    implementation 'com.jakewharton:butterknife:10.0.0'

    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.exifinterface:exifinterface:1.0.0'
    implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0-alpha01'
    implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
    implementation 'androidx.browser:browser:1.0.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.palette:palette:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha04'
    implementation 'com.google.android.material:material:1.1.0-alpha05'
    implementation 'com.google.android.material:material:1.1.0-alpha05'
    implementation 'androidx.core:core:1.1.0-alpha05'
    implementation 'androidx.annotation:annotation:1.1.0-beta01'
    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
    implementation 'com.squareup.okhttp3:okhttp:3.12.1'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'org.greenrobot:eventbus:3.1.1'
    implementation 'com.github.rey5137:material:1.2.5'
    implementation 'com.pnikosis:materialish-progress:1.5'
//    implementation 'com.daimajia.slider:library:1.1.5@aar'
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'com.commonsware.cwac:merge:1.1.2'
    implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
    implementation 'com.google.code.findbugs:jsr305:3.0.2'
    implementation 'com.marshalchen.ultimaterecyclerview:library:0.3.18'
    implementation 'com.github.markomilos:paginate:0.5.1'
    implementation 'com.google.android.gms:play-services-vision:17.0.2'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.malinskiy:superrecyclerview:1.1.1'
    implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
    implementation 'com.flipboard:bottomsheet-core:1.5.0'
    implementation 'com.flipboard:bottomsheet-commons:1.5.0'
    implementation 'org.apmem.tools:layouts:1.10@aar'
    implementation(name: 'persiandatepicker-release', ext: 'aar')
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.8@aar') {
        transitive = true;
    }
    implementation 'com.jakewharton:butterknife:10.0.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
    implementation 'com.binjar.prefsdroid:prefs-droid:1.1.0'
    implementation 'com.google.firebase:firebase-messaging:17.6.0'
    implementation 'com.google.firebase:firebase-core:16.0.8'
    implementation 'org.jetbrains:annotations-java5:15.0'
    implementation 'com.google.inject:guice:4.2.2'
    implementation "io.smooch:core:${smooch_chat_librar_version}"
    implementation "io.smooch:ui:${smooch_chat_librar_version}"

}

apply plugin: 'com.google.gms.google-services'

build.gradle

//Файл сборки верхнего уровня, в который вы можете добавить параметры конфигурации, общие для всех подпроектов/модулей.

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://s3.amazonaws.com/repo.commonsware.com' }
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        //vahhab change to 3.2.0
        classpath 'com.android.tools.build:gradle:3.3.1'
        //classpath 'com.android.tools.build:gradle:3.2.1'


        //classpath 'com.google.gms:google-services:2.0.0-alpha3'
        classpath 'com.google.gms:google-services:4.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}


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

    dependencies {
        // These docs use an open ended version so that our plugin
        // can be updated quickly in response to Android tooling updates

        // We recommend changing it to the latest version from our changelog:
        // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
        classpath 'io.fabric.tools:gradle:1.27.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://s3.amazonaws.com/repo.commonsware.com' }
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
        maven { url 'https://jitpack.io' }
        flatDir { dirs 'libs' }
    }
}
Теги:
gradle
build.gradle
android-multidex
androidx

1 ответ

0

Вы должны включить jetifier в файле gradle.properties.

android.enableJetifier=true

удалите папки .gradle и .idea, затем пересоберите проект.

  • 0
    Я сделал это уже для включения AndroidX, однако это не изменит ситуацию.
  • 0
    Вы можете попробовать использовать androidx.multidex:multidex:2.0.0 вместо androidx.multidex:multidex:2.0.1 ?

Ещё вопросы

Сообщество Overcoder
Наверх
Меню