Open giscafer opened 7 years ago
haxm not compatible with windows
12:16:16 E/adb: Unable to obtain result of 'adb version' :app:installDebug FAILED
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:installDebug'. com.android.builder.testing.api.DeviceException: Timeout getting device list.
http://stackoverflow.com/questions/34754816/react-native-run-android-appinstalldebug-failed http://stackoverflow.com/questions/35959350/react-native-android-genymotion-adb-server-didnt-ack
Error occurred during initialization of VM Unable to allocate 130176KB bitmaps for parallel garbage collection for the requested 4165632KB heap. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
内存不足
unfortunately AwesomeProject has stoped
http://stackoverflow.com/questions/35406657/react-native-android-application-has-stopped
Invariant Violation:Applicaction 项目名 has not been registered.This is either due to a require() error during initialization or failure to call AppRegistry.registerCommponent.
程序名称没有保持一致或者是如react-native在运行程序A而你打开了程序B,也会出现相同的问题。解决方法很简单,关掉命令行运行程序。ctrl+c,运行你想运行的程序。
could not get BatchedBridge , make sure your bundle is packaged correctly
解决方案1:
在演示机(或虚拟机)上Dev Setting
里设置IP和端口,eg:127.0.0.1:8081
然后访问:http://IP:端口/index.android.bundle?platform=android&dev=true&hot=false&minify=false
验证是否正常,正确后即可解决。
方案2:
1、Create theandroid/app/src/main/assets
folder
2、run react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --sourcemap-output android/app/src/main/assets/index.android.map --assets-dest android/app/src/main/res/
on the project root
3、Then assets will generate three filesindex.android.bundle
index.android.bundle.meta
index.android.map
4、Last run project react-native run-android
Element type is invalid: expected a String(for built-in components) or a class/function(for composite components) but got:object
double rr刷新后 cannot connect to development server
Execution failed for task ':app:preDexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.E xecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_101\bin\java.exe' ' finished with non-zero exit value 1
cd android && ./gradlew clean && cd ..
Problem
Solving:
没有启动AVD,启动模拟器后再执行语句即可
参考:https://github.com/facebook/react-native/issues/2711