我按照适用于 Windows 和 Android 的“使用本机代码构建项目”选项卡中的React Native 入门的说明进行操作。
这是 \AwesomeProject\android\build.gradle 的内容,之后执行时出现错误:react-native run-android
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.2"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories { …
Run Code Online (Sandbox Code Playgroud)