无法解析依赖项 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"
}
}
}
}
我已经尝试了很多但我遇到了这个问题尝试生成发布版本
无法找到 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"
}
}
}
}