我正在开始使用本机反应。安装Android Studio后,
和JDK,我尝试使用react-native run-android
但我收到此错误:
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/riccardoconti/Documents/ReactNative/rncourse/android/app/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Uninitialized object exists on backward branch 70
Exception Details:
Location:
com/android/build/gradle/internal/scope/BuildArtifactsHolder.newArtifact(Lcom/android/build/api/artifact/BuildableArtifact;)Lcom/android/build/gradle/internal/scope/BuildArtifactsHolder$BuildableArtifactData; @119: goto
Reason:
Error exists in the bytecode
Bytecode:
0x0000000: bb02 0559 2bb9 0208 0100 c000 b82b b902
0x0000010: 0c01 0001 b902 1202 0059 1302 14b8 0051
0x0000020: c001 734d 3a0d 3a0c 3a0b 2c4e bb01 a659
0x0000030: 2c10 0ab8 0177 b701 a7c0 00b8 3a04 2db9
0x0000040: 018e 0100 3a05 1905 b901 9401 0099 002d
0x0000050: 1905 b901 9801 003a 0619 0419 06c0 00f1
0x0000060: 3a07 3a0e 1907 b902 1501 003a 0f19 0e19
0x0000070: 0fb9 01ad 0200 57a7 ffcf 1904 c001 af3a
0x0000080: 0e19 0b19 0c19 0d19 0eb7 0218 b0
Stackmap Table:
full_frame(@70,{Object[#2],Object[#83],Object[#371],Object[#371],Object[#184],Object[#400],Top,Top,Top,Top,Top,Uninitialized[#0],Uninitialized[#0],Object[#184]},{})
same_frame(@122)
* 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 0s
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
我已经尝试过但没有成功的东西:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
有任何线索吗?
谢谢。