在模拟器中反应原生运行的android抛出错误

时间:2017-09-10 20:03:30

标签: android react-native

我安装react native并打开一个新项目。 我试着跑

react-native run-android

我收到此错误

    PS E:\Projects\React native\myapp> react-native run-android
Scanning 574 folders for symlinks in E:\Projects\React native\myapp\node_modules (27ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...

FAILURE: Build failed with an exception.

* Where:
Build file 'E:\⌠°σΘΘ≈ΦΘφ\⌠°σΘΘ≈ΦΘφ ≈Θ⌡\React native\myapp\android\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.

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

BUILD FAILED

Total time: 2.877 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

1 个答案:

答案 0 :(得分:0)

从错误中可以看出,您需要将项目移动到不带非ASCII字符的其他目录。

  

您的项目路径包含非ASCII字符。这将是最多的   可能导致构建在Windows上失败。请移动你的项目   到另一个目录。有关详细信息,请参阅Ceylon Herd scrutiny