sfl*_*low 5 android android-gradle-plugin react-native react-native-android
当我尝试在 React Native 项目中构建 Android 应用程序时出现构建错误。
当我运行时react-native run-android
,它说:
> Configure project :react-native-os
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-os'.
> compileSdkVersion is not specified.
Run Code Online (Sandbox Code Playgroud)
在 Android Studio 中,我可以看到它说的是同样的话:
Cause: compileSdkVersion is not specified.
所以我在 Android Studio 中编辑了 build.gradle(Module: app) 文件,但问题仍然存在,错误信息没有改变。
android {
// compileSdkVersion rootProject.ext.compileSdkVersion
compileSdkVersion 28
buildToolsVersion "28.0.3"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Run Code Online (Sandbox Code Playgroud)
我在其他线程中尝试过类似这样的解决方案,但没有任何效果。有谁知道这里的问题是什么?
归档时间: |
|
查看次数: |
16534 次 |
最近记录: |