Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native run-android issues #3

Open
giscafer opened this issue Feb 11, 2017 · 9 comments
Open

react-native run-android issues #3

giscafer opened this issue Feb 11, 2017 · 9 comments

Comments

@giscafer
Copy link
Owner

giscafer commented Feb 11, 2017

Problem

Execution failed for task ':app:installDebug'.
com.android.builder.testing.api.DeviceException: No connected devices!

Solving:

没有启动AVD,启动模拟器后再执行语句即可

emulator -avd [AVD_for_Nexus_6_by_Google]

react-native run-android

参考:facebook/react-native#2711

@giscafer
Copy link
Owner Author

@giscafer
Copy link
Owner Author

giscafer commented Feb 12, 2017

Problem

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

@giscafer
Copy link
Owner Author

giscafer commented Feb 12, 2017

Problem

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.

内存不足

@giscafer
Copy link
Owner Author

Problem

unfortunately AwesomeProject has stoped

http://stackoverflow.com/questions/35406657/react-native-android-application-has-stopped

@giscafer
Copy link
Owner Author

Problem

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,运行你想运行的程序。

http://www.jianshu.com/p/82a09063e61c

@giscafer
Copy link
Owner Author

giscafer commented Feb 20, 2017

Problem

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 the android/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 files index.android.bundle index.android.bundle.meta index.android.map

4、Last run project react-native run-android

http://stackoverflow.com/questions/38870710/error-could-not-get-batchedbridge-make-sure-your-bundle-is-packaged-properly

facebook/react-native#9336

http://www.cnblogs.com/LiuZhen/p/5971176.html

@giscafer
Copy link
Owner Author

Problem

Element type is invalid: expected a String(for built-in components) or a class/function(for composite components) but got:object

@giscafer
Copy link
Owner Author

Problem

double rr刷新后 cannot connect to development server

@giscafer
Copy link
Owner Author

giscafer commented Feb 22, 2017

Problem

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 ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant