簡體   English   中英

由於“找不到 multidex-instrumentation.aar”,任務“:app:lintVitalRelease”執行失敗

[英]Execution failed for task ':app: lintVitalRelease' due to `Could not find multidex-instrumentation.aar`

當我嘗試在 android studio 中同步我的應用模塊時,它會提示錯誤:

錯誤:無法解決:multidex-instrumentation 受影響的模塊:app

當我嘗試運行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 Repository中。

這是我的build.gradleapp.gradle

應用程序.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'

構建.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.properties 文件中啟用 jetifier。

android.enableJetifier=true

刪除 .gradle 和 .idea 文件夾,然后重建項目。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM