Monaca Onsen UI Discord Chat Github Repo

app hangs on splash screen



  • hi, i just migrated my phonegap app to monaca and it was amazingly easy transition. i was able to import my project and after fixing a couple of things i was able to build for android and for iphone. the app works fine on both except that the initial splash screen will not close. once i touch the phone the splash screen closes and the app works fine. but at launch the splash screen will not close until the phone is touched. the code is unchanged from when i used adobe build and the splash screen closed after a couple seconds. i have cordova splashscreen plugin included in the project, it seems to be fine. my best guess is that the problem involves this line of js code at start of app:
    document.addEventListener(“deviceready”, on_device_ready,false);

    it seems like maybe deviceready is never triggered? any help is appreciated. thanks.



  • @johnd2323,

    1. What plugins are you using?
    2. Show your config.xml
    3. Where you testing?

    or better yet, upload a reproducible sample.



  • @jamal
    thanks jamal. your response focussed my attention on config.xml, and i found this interesting line:
    <preference name=“AutoHideSplashScreen” value=“undefined”/>
    i don’t think i saw a setting anywhere in the monaca cloud ide that would have created that entry. i changed “undefined” to “true” and rebuilt, and now the splash screen behaves correctly, disappearing after a second or two. so thank you, your response alone had a great affect! do you know if there’s a setting in the dashboard that affects the value of that entry in config.xml?



  • This didn’t work for me. In addition, the splash screen doesn’t even disappear when touched. I’m testing on an iPhone 6s running ios 13.4.1. Any help would be appreciated. Here’s my config.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <widget xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" id="com.eternalcompanyltd.maya" version="2.3.0">
      <name>Maya</name>
      <description>Made with Monaca (http://monaca.mobi)</description>
      <author/>
      <content src="index.html"/>
      <allow-navigation href="*"/>
      <allow-intent href="itms:*"/>
      <allow-intent href="itms-apps:*"/>
      <preference name="Orientation" value="default"/>
      <preference name="loglevel" value="DEBUG"/>
      <preference name="AndroidLaunchMode" value="singleTop"/>
      <preference name="ErrorUrl" value=""/>
      <preference name="Fullscreen" value="false"/>
      <preference name="KeepRunning" value="true"/>
      <preference name="SplashScreen" value="screen"/>
      <preference name="SplashScreenDelay" value="1000"/>
      <preference name="AllowInlineMediaPlayback" value="false"/>
      <preference name="BackupWebStorage" value="cloud"/>
      <preference name="FadeSplashScreenDuration" value="250"/>
      <preference name="KeyboardDisplayRequiresUserAction" value="true"/>
      <preference name="MediaPlaybackRequiresUserAction" value="false"/>
      <preference name="SuppressesIncrementalRendering" value="false"/>
      <preference name="TopActivityIndicator" value="gray"/>
      <preference name="GapBetweenPages" value="0"/>
      <preference name="PageLength" value="0"/>
      <preference name="PaginationBreakingMode" value="page"/>
      <preference name="PaginationMode" value="unpaginated"/>
      <feature name="LocalStorage">
        <param name="ios-package" value="CDVLocalStorage"/>
      </feature>
      <preference name="UIWebViewDecelerationSpeed" value="normal"/>
      <preference name="monaca:AndroidIsPackageNameSeparate" value="false"/>
      <platform name="ios">
        <preference name="orientation" value="all"/>
        <icon src="/res/ios/icon/icon.png" width="57" height="57"/>
        <icon src="/res/ios/icon/icon@2x.png" width="114" height="114"/>
        <icon src="/res/ios/icon/icon-72.png" width="72" height="72"/>
        <icon src="/res/ios/icon/icon-72@2x.png" width="144" height="144"/>
        <icon src="/res/ios/icon/icon-60.png" width="60" height="60"/>
        <icon src="/res/ios/icon/icon-60@2x.png" width="120" height="120"/>
        <icon src="/res/ios/icon/icon-60@3x.png" width="180" height="180"/>
        <icon src="/res/ios/icon/icon-76.png" width="76" height="76"/>
        <icon src="/res/ios/icon/icon-76@2x.png" width="152" height="152"/>
        <icon src="/res/ios/icon/icon-40.png" width="40" height="40"/>
        <icon src="/res/ios/icon/icon-40@2x.png" width="80" height="80"/>
        <icon src="/res/ios/icon/icon-50.png" width="50" height="50"/>
        <icon src="/res/ios/icon/icon-50@2x.png" width="100" height="100"/>
        <icon src="/res/ios/icon/icon-small.png" width="29" height="29"/>
        <icon src="/res/ios/icon/icon-small@2x.png" width="58" height="58"/>
        <icon src="/res/ios/icon/icon-small@3x.png" width="87" height="87"/>
        <icon src="/res/ios/icon/icon-83.5@2x~ipad.png" width="167" height="167"/>
        <icon src="/res/ios/icon/icon-1024.png" width="1024" height="1024"/>
        <splash src="/res/ios/screen/Default@2x~universal~anyany.png"/>
        <preference name="WKWebViewOnly" value="true"/>
        <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine"/>
        <feature name="CDVWKWebViewEngine">
          <param name="ios-package" value="CDVWKWebViewEngine"/>
        </feature>
        <config-file platform="ios" parent="CFBundleLocalizations" target="*-Info.plist">
          <array>
            <string>en</string>
            <string>fr</string>
          </array>
        </config-file>
      </platform>
      <platform name="android">
        <icon src="/res/android/icon/ldpi.png" density="ldpi"/>
        <icon src="/res/android/icon/mdpi.png" density="mdpi"/>
        <icon src="/res/android/icon/hdpi.png" density="hdpi"/>
        <icon src="/res/android/icon/xhdpi.png" density="xhdpi"/>
        <icon src="/res/android/icon/xxhdpi.png" density="xxhdpi"/>
        <icon src="/res/android/icon/xxxhdpi.png" density="xxxhdpi"/>
        <splash src="/res/android/screen/splash-port-ldpi.9.png" density="port-ldpi"/>
        <splash src="/res/android/screen/splash-port-mdpi.9.png" density="port-mdpi"/>
        <splash src="/res/android/screen/splash-port-hdpi.9.png" density="port-hdpi"/>
        <splash src="/res/android/screen/splash-port-xhdpi.9.png" density="port-xhdpi"/>
        <splash src="/res/android/screen/splash-port-xxhdpi.9.png" density="port-xxhdpi"/>
        <splash src="/res/android/screen/splash-port-xxxhdpi.9.png" density="port-xxxhdpi"/>
        <splash src="/res/android/screen/splash-mdpi.png" density="mdpi"/>
      </platform>
      <platform name="electron">
        <icon src="/res/electron/icon/icon_electron_512.png" width="512" height="512"/>
        <splash src="/res/electron/screen/electron_splash_image.png" width="620" height="300"/>
        <preference name="SplashScreenWidth" value="620"/>
        <preference name="SplashScreenHeight" value="300"/>
        <preference name="ShowSplashScreen" value="false"/>
      </platform>
      <preference name="WindowsStorePublisherName" value="My Name"/>
      <preference name="WindowsStoreIdentityName" value="9d3375b4-8a84-c3c6-0bc9-e27d90e64a4b"/>
      <preference name="ios-XCBuildConfiguration-TARGETED_DEVICE_FAMILY" value="1,2"/>
      <preference name="AutoHideSplashScreen" value="true"/>
      <preference name="FadeSplashScreen" value="false"/>
      <preference name="ShowSplashScreenSpinner" value="true"/>
      <access origin="*"/>
      <preference name="DisallowOverscroll" value="true"/>
      <preference name="EnableViewportScale" value="false"/>
    </widget>
    
    

  • administrators

    @ipkiss Can you provide a reproducible sample?

    You could also try deleting the splashscreen preferences in config.xml and setting the splashscreen using the Monaca Cloud IDE menus.