簡體   English   中英

無法解析依賴項 androidx.test:core:1.9.0-alpha01

[英]Unable to resolve dependency androidx.test:core:1.9.0-alpha01

我已經嘗試了很多但我有這個問題嘗試生成發布版本

找不到 androidx.test:core:1.9.0-alpha01。 在以下位置搜索:

   - https://dl.google.com/dl/android/maven2/androidx/test/core/1.9.0-alpha01/core-1.9.0-alpha01.pom
   - https://jcenter.bintray.com/androidx/test/core/1.9.0-alpha01/core-1.9.0-alpha01.pom
   - https://repo.maven.apache.org/maven2/androidx/test/core/1.9.0-alpha01/core-1.9.0-alpha01.pom

請協助我解決此錯誤

Gradle:

ext {
 // region Testing
    junit_version = '4.13.2'
    espresso_version = '3.5.0-alpha04'
    mockito_version = '4.3.1'
    mockito_android_version = '4.3.1'
    test_version = '1.9.0-alpha01'
    test_ext_version = '1.1.4-alpha04'
    arch_testing_version = '2.1.0'
    // endregion
}



android {

    compileSdkVersion 32
       
}

androidExtensions {
    experimental = true
}

dependencies {
  

    // region Testing - JUnit
    testImplementation "junit:junit:$junit_version"
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutine_version"
    testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp_version"
    testImplementation "org.mockito:mockito-core:$mockito_version"
    // endregion

    // region Testing - Instrumented
    androidTestImplementation "androidx.test:core:$test_version"
    androidTestImplementation "androidx.test:runner:$test_version"
    androidTestImplementation "androidx.test:monitor:$test_version"
    androidTestImplementation "androidx.test:rules:$test_version"
    androidTestImplementation "androidx.test.ext:junit:$test_ext_version"
    androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
    androidTestImplementation "androidx.arch.core:core-testing:$arch_testing_version"
    androidTestImplementation "androidx.room:room-testing:$room_version"
    androidTestImplementation "org.mockito:mockito-core:$mockito_version"
    androidTestImplementation "org.mockito:mockito-android:$mockito_android_version"
    androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutine_version"
    androidTestImplementation "com.squareup.okhttp3:mockwebserver:$okhttp_version"
    androidTestUtil "androidx.test:orchestrator:$test_version"
    // endregion

  
}

嘗試改變這個:

test_version = '1.9.0-alpha01'

對此:

test_version = '1.4.1-alpha04'

(我認為您聲明的版本不存在: https://developer.android.com/jetpack/androidx/releases/test

subprojects {
  project.configurations.all {
     resolutionStrategy.eachDependency { details ->
        if (details.requested.group == 'com.android.support'
              && !details.requested.name.contains('multidex') ) {
           details.useVersion "version which should be used - in your case 26.0.0-beta2"
        }
     }
  }
}

暫無
暫無

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

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