cordova-create-react-app icon indicating copy to clipboard operation
cordova-create-react-app copied to clipboard

Empty screen

Open Er-rchydy opened this issue 6 years ago • 6 comments

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

Er-rchydy avatar Sep 27 '18 09:09 Er-rchydy

Same here... with Cordova 7

towfiqi avatar Dec 09 '18 14:12 towfiqi

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.

gitcalculus avatar Dec 17 '18 07:12 gitcalculus

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.

towfiqi avatar Dec 17 '18 07:12 towfiqi

Hey @towfiqi, what did you do to make it work? I still get an empty screen.

lMoshe avatar Jan 07 '19 21:01 lMoshe

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.

WTFlay avatar Mar 07 '19 09:03 WTFlay

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

salmanul avatar Sep 09 '20 03:09 salmanul