Home > other >  Unable to resolve dependency androidx.test:core:1.9.0-alpha01
Unable to resolve dependency androidx.test:core:1.9.0-alpha01

Time:03-03

I have tried lot but I having this issue try generate release build

Could not find androidx.test:core:1.9.0-alpha01. Searched in the following locations:

   - 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

Kindly assist me to resolve this error

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

  
}

CodePudding user response:

Try changing this:

test_version = '1.9.0-alpha01'

To this:

test_version = '1.4.1-alpha04'

(I think the version you declared doesn't exist: https://developer.android.com/jetpack/androidx/releases/test)

CodePudding user response:

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"
        }
     }
  }
}
  • Related