首页 > 解决方案 > 如何修复构建 gradle asemble 版本在 react native 0.59 中失败

问题描述

我想生成我的项目反应原生,但我有一些问题

它在我的 Android 的 sdk 版本中

>
> Configure project :react-native-vector-icons
WARNING: The specified Android SDK Build Tools version (28.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture fingerprint of input files for task ':app:bundleReleaseJsAndAssets' property '$1' during up-to-date check.
> Could not list contents of '/Users/halojasa/halojasa_com/node_modules/node-pre-gyp/node_modules/.bin/detect-libc'. Couldn't follow symbolic link.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s
85 actionable tasks: 1 executed, 84 up-to-date

现在我无法发布我的应用程序,请有人帮助我。. . .

标签: reactjsreact-nativebuild.gradle

解决方案


将这些行添加到android/build.gradle所有项目代码中

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 28
                buildToolsVersion "28.0.2"
            }
        }
    }
}
allprojects {
 ...all project stuff...
}

推荐阅读