首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >任务:react-native-splash-screen:processDebugAndroidTestManifest失败

任务:react-native-splash-screen:processDebugAndroidTestManifest失败
EN

Stack Overflow用户
提问于 2022-05-18 23:38:41
回答 1查看 346关注 0票数 0

我想逃跑的命令:

./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug

大多数进展都没有失败,但在接近90%的情况下我得到了一条错误消息。

错误信息:

代码语言:javascript
复制
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 logs

build.gradle

代码语言:javascript
复制
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“似乎也无济于事。

EN

回答 1

Stack Overflow用户

发布于 2022-05-19 18:39:26

我在github https://github.com/uxcam/react-native-ux-cam/issues/24#issuecomment-892547229上找到了一个可行的解决方案,将它添加到build.gradle中似乎可以解决这个问题。

代码语言:javascript
复制
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
                }
            }
        }
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72297098

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档