【发布时间】:2020-12-17 12:15:20
【问题描述】:
我正在尝试使用 react-native 运行一个项目。
我遵循了Viro's website.中给出的所有步骤
当尝试使用react-native run-android 构建项目时,我收到以下错误:
Could not compile build file '\ARDemo\android\build.gradle'.
启动失败: 构建文件 '\ARDemo\android\build.gradle':12:意外令牌:} @ 第 12 行,第 1 列。 } ^
1 个错误
-
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
-
通过https://help.gradle.org获得更多帮助
8 秒后构建失败
错误安装失败
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
} // --> error is detected in this line
allprojects {
// Workaround for https://issuetracker.google.com/117900475
// Remove when upgrading to AGP 3.4 or higher
configurations.matching { it.name == '_internal_aapt2_binary' }.all { config ->
config.resolutionStrategy.eachDependency { details ->
details.useVersion("3.5.0-alpha03-5252756")
}
}
repositories {
mavenLocal()
maven {
url 'https://maven.google.com/'
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
【问题讨论】:
-
您好像放了多余的大括号或忘记添加了
标签: android react-native gradle virtual-reality