我无法在react-native上运行我的android应用

时间:2019-05-29 09:37:22

标签: android react-native

我无法运行我的项目。我正在尝试修复2个错误,但我什么也没得到。

我做了这里写的所有事情:

https://facebook.github.io/react-native/docs/getting-started

C:\WINDOWS\system32>cd BabyMobile

C:\Windows\System32\BabyMobile>react-native run-android
info Starting JS server...
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...
Starting a Gradle Daemon, 3 stopped Daemons could not be reused, use --status for details
> Task :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
  C:\Windows\System32\BabyMobile\android\app\build\intermediates\res\merged\debug: error: directory does not exist.


* 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 26s
9 actionable tasks: 1 executed, 8 up-to-date
error 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/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.

C:\Windows\System32\BabyMobile>adb devices
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully

你能帮我吗?

**已修复:已更新android studio,项目已在常规CMD中初始化(不是以admin身份)。第二个问题是,我在运行react-natice run-android之后打开了模拟器,所以您必须先启动模拟器!

0 个答案:

没有答案