我想逃跑的命令:
./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug
大多数进展都没有失败,但在接近90%的情况下我得到了一条错误消息。
错误信息:
Task :react-native-splash-screen:processDebugAndroidTestManifest FAILED
[androidx.vectordrawable:vectordrawable-animated:1.0.0] /Users/devingantt/.gradle/caches/transforms-3/8513b8b73b7884b15d157c479782c91b/transformed/vectordrawable-animated-1.0.0/AndroidManifest.xml Warning:
Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.vectordrawable:vectordrawable:1.0.1.
/Users/devingantt/Documents/pqaa_detox/node_modules/react-native-splash-screen/android/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest1586857056775225339.xml:5:5-74 Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.68.2] /Users/devingantt/.gradle/caches/transforms-3/20ecbe39ea883ff454b9d4682071f45b/transformed/jetified-react-native-0.68.2/AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.facebook.react" to force usage (may lead to runtime failures)
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-splash-screen:processDebugAndroidTestManifest'.
> Manifest merger failed with multiple errors, see logsbuild.gradle
buildscript {
ext {
ext.kotlinVersion = '1.3.40' // (check what the latest version is!)
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
buildToolsVersion = "29.0.2"
}
repositories {
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:7.0.2')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}我很难理解错误信息,因为我的minSdkVersion是21,应该比出现的16更高。在回购中搜索"16“似乎也无济于事。
发布于 2022-05-19 18:39:26
我在github https://github.com/uxcam/react-native-ux-cam/issues/24#issuecomment-892547229上找到了一个可行的解决方案,将它添加到build.gradle中似乎可以解决这个问题。
subprojects {
...
afterEvaluate { subproject ->
if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
}
}
}
}
}https://stackoverflow.com/questions/72297098
复制相似问题