PhoneGap Build iOS app has blank white screen after splash screen

后端 未结 7 1800
庸人自扰
庸人自扰 2020-12-04 22:38

I\'m using PhoneGap Build 3.0, attempting to get rid of the blank white screen that appears after the splash screen.

I\'ve done research and all I can find is refere

相关标签:
7条回答
  • 2020-12-04 23:03

    I want to add that I had a similar issue and in my case it was not the splash screen.

    In my case using PhoneGap build and Git, I added a javascript file to my app but failed to include and push the new file to my git repository. This caused my the app to work locally but when the build server pulled the latest code, it showed the white screen on the PhoneGap build.

    PhoneGap initialized, but Kendo UI did not like the missing referenced js class and failed. It was a PhoneGap noob mistake but i want to share just incase it helps someone who has a similar issue and the splash screen fix does not work. It could be a javascript error occurring before your mobile ui framework loads.

    0 讨论(0)
  • 2020-12-04 23:04

    I have the same problem "blank white screen after splash screen". For some reason I got this message in emulator iOS debug log:

    deviceready has not fired after 5 seconds
    

    It was resolved removing this meta tag from my index.html

    <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
    

    Now it is working in iOS (No tested in android). Reference #1 here!

    Also this is the documentation of cordova-plugin-splashscreen. (search for "iOS Quirk:"). Reference #2 here!

    0 讨论(0)
  • 2020-12-04 23:10

    Try set the background color, on the configs and html. Example blue:

    <preference name="SplashMaintainAspectRatio" value="false" />
    <preference name="SplashScreenDelay" value="1" />
    <preference name="backgroundColor" value="0xff0000ff" />
    

    and on the html tag

    <html style="background-color:#0000ff;>
    
    0 讨论(0)
  • 2020-12-04 23:10

    This are the steps

    1) Add Splash screen preference in config.xml

    <preference
        name="SplashScreen"
        value="screen" />
    <preference
        name="AutoHideSplashScreen"
        value="true" />
    <preference
        name="SplashScreenDelay"
        value="5000" />
    
    <feature name="SplashScreen" >
        <param
            name="android-package"
            value="org.apache.cordova.splashscreen.SplashScreen" />
    
        <param
            name="onload"
            value="true" />
    </feature>
    

    2) Declare your splash screens in config.xml

        <!-- you can use any density that exists in the Android project -->
        <splash
            density="land-hdpi"
            src="res/drawable-land-hdpi/splash.png" />
        <splash
            density="land-ldpi"
            src="res/drawable-land-ldpi/splash.png" />
        <splash
            density="land-mdpi"
            src="res/drawable-land-mdpi/splash.png" />
        <splash
            density="land-xhdpi"
            src="res/drawable-land-xhdpi/splash.png" />
        <splash
            density="port-hdpi"
            src="res/drawable-hdpi/splash.png" />
        <splash
            density="port-ldpi"
            src="res/drawable-ldpi/splash.png" />
        <splash
            density="port-mdpi"
            src="res/drawable-mdpi/splash.png" />
        <splash
            density="port-xhdpi"
            src="res/drawable-xhdpi/splash.png" />
    </platform>
    

    3) Finally Add this class into your android project structure under org.apache.cordova.splashscreen package

    or

    install it as Cordova plugin.

    0 讨论(0)
  • 2020-12-04 23:11

    If you were using whitelist plugin for your app, you may need a change in config.xml as follows to work with phonegap build.

    <gap:plugin name="cordova-plugin-whitelist" source="npm" version="~1" />
    

    This was the cli spec in my config.xml.

    <preference name="phonegap-version" value="cli-5.2.0" />
    
    0 讨论(0)
  • 2020-12-04 23:11

    I had similar issue only on iOS and in my case it was related to the way I implemented styles on index.html. In my case I had to provide styling for different brands and it was dependent on $scope variable. I used @import inside body and apparently iOS has a problem with it. I solved it by putting CSS links back to head. I used $rootScope and ng-if to trigger correct styles based on brand name. Somehow it was with @import it resulted with blank white screen after splash screen... I hope it can help anyone having same problem.

    0 讨论(0)
提交回复
热议问题