生成APK后反应原生黑屏 [英] React native blank screen after generating APK
问题描述
我使用的是react-native,开发过程中一切正常,但是,当我构建APK时(使用本教程:
I'm using react-native, and everything was working well while I was developing, but, when I built the APK (using this tutorial: https://facebook.github.io/react-native/docs/signed-apk-android.html#content) and installed it on my device, the app shows just a blank page.
Did anybody had the same issue?
我查看了设备上的日志,这是错误:
I looked at the log on the device, and this is the error:
11-09 22:00:51.115 16525 16525 W未知:反应:您似乎正在设备上运行.运行'adb reverse tcp:8081 tcp:8081'将调试服务器的端口转发到设备.
11-09 22:00:51.115 16525 16525 W未知:反应:您似乎正在设备上运行.运行'adb reverse tcp:8081 tcp:8081'将调试服务器的端口转发到设备.
11-09 22:00:51.198 16525 16555 E ReactNative:得到了JS异常:SyntaxError:意外的标记':'.解析错误.
11-09 22:00:51.115 16525 16525 W unknown:React: You seem to be running on device. Run 'adb reverse tcp:8081 tcp:8081' to forward the debug server's port to the device.
11-09 22:00:51.115 16525 16525 W unknown:React: You seem to be running on device. Run 'adb reverse tcp:8081 tcp:8081' to forward the debug server's port to the device.
11-09 22:00:51.198 16525 16555 E ReactNative: Got JS Exception: SyntaxError: Unexpected token ':'. Parse error.
谢谢.
推荐答案
好的,我在构建之前通过运行以下命令解决了该问题:
Ok I solved the issue by running the following command before building:
curl" http://localhost:8081/index.android.bundle?platform =android "-o"android/app/src/main/assets/index.android.bundle"
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
这篇关于生成APK后反应原生黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!