[英]Running react native bare project results in error A problem occurred configuring project ':react-native-reanimated'
I have installed react native through the expo kit and now when I run yarn run android I received that error.我已经通过 expo 套件安装了 react native,现在当我运行 yarn run android 时,我收到了该错误。 I haven't changed anything on the template.我没有更改模板上的任何内容。 I don't know what is happening.?我不知道发生了什么。? If there are further about feel free to ask.如果有进一步的关于随时问。 I have also checked the build.gradle of react native reanimated but,unfortunately, no success has shown up.我还检查了 react native reanimated 的 build.gradle,但不幸的是,没有成功。
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\David\Desktop\TheGuruApp\node_modules\react-native-reanimated\android\build.gradle' line: 89
* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> java.io.IOException: The filename, directory name, or volume label syntax is incorrect
* 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
BUILD FAILED in 28s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\David\Desktop\TheGuruApp\node_modules\react-native-reanimated\android\build.gradle' line: 89
* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> java.io.IOException: The filename, directory name, or volume label syntax is incorrect
* 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
BUILD FAILED in 28s
You have install Android API level 29 and reopen the project... then it will fix itself.您已安装 Android API 级别 29 并重新打开项目...然后它会自行修复。
Just go to sdk manager from android studio and install android 10.0(Q) level 29, show package details google apis intelx86 Atom system image Just go to sdk manager from android studio and install android 10.0(Q) level 29, show package details google apis intelx86 Atom system image
and restart android studio and open the project it will work... image并重新启动 android 工作室并打开它将工作的项目......图片
You need to setup your development environment for react native.您需要设置您的开发环境以进行本机反应。 Use the following link使用以下链接
https://reactnative.dev/docs/environment-setup https://reactnative.dev/docs/environment-setup
Also check the jdk version it should be above or 11.0还要检查它应该高于或 11.0 的 jdk 版本
The below mentioned code inside build.gradle
( node_modules\react-native-reanimated\android\build.gradle
) is problematic:下面提到的build.gradle
( node_modules\react-native-reanimated\android\build.gradle
) 中的代码有问题:
android.libraryVariants.all { variant ->
def name = variant.name.capitalize()
task "jar${name}"(type: Jar, dependsOn: variant.javaCompileProvider.get()) {
from variant.javaCompileProvider.get().destinationDir
}
}
If this is replaced with the below mentioned code, the said problem is fixed.如果将其替换为下面提到的代码,则上述问题已得到解决。
android.libraryVariants.all { variant ->
def name = variant.name.capitalize()
task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) {
from variant.javaCompile.destinationDir
}
}
In my case, on windows, was the wrong Android SDK path on local.properties file.就我而言,在 windows 上,local.properties 文件上的 Android SDK 路径是错误的。 Needs double backslashes需要双反斜杠
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.