cordova-create-react-app
cordova-create-react-app copied to clipboard
Empty screen
i followed everything you mentioned, but at the end when i run cordova emulator androind
the emulator started but i only got empty white screen.
cordova version: 8.1.0
React version: 16.5.2
Same here... with Cordova 7
Maybe
npm install --save babel-polyfill
and
import 'babel-polyfill';
to index.js will fixed empty screen. make sure import this before import 'react'.
I have got blank white screen too. and i use Android Studio to debug. find some erro log.(what i found is "Set is not defined"). find something like This.
Hi, I am here to report that I made a premature comment before. it works fine with Cordova 7, the issue was with my end.
Hey @towfiqi, what did you do to make it work? I still get an empty screen.
Hello,
The empty screen is about by the line:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
When you run the index.html in a browser, you got some error about the Content-Security-Policy
.
add 'unsafe-inline' to default-src,
<!--
Customize this policy to fit your own app's needs. For more guidance, see:
https://github.com/apache/cordova-plugin-whitelist/blob/master/README.md#content-security-policy
Some notes:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
-->