Game fails to launch with iOS 10 + Cordova

0 favourites
From the Asset Store
Creepy Sprite Font suitable font for your Dark/Horror/Halloween games.
  • A game that passed App Review a few weeks ago has ended up being unplayable once users upgrade to iOS 10. After the splash screen, there is just a black screen and nothing appears to load. Has anyone experienced this and found a workaround?

    I've stripped everything down to the most basic C2 project I could: a single layout with one "Hello, World" text object. This issue is consistently reproducible for me with Cordova 6.3.1 and iOS platform 4.2.1. C2 is latest stable r233.

    Steps:

    $ cordova create testapp com.mycompany.testapp testapp

    $ cd testapp

    $ cordova platform add ios --save

    (Copy any exported C2 project to "www" folder)

    $ cordova prepare ios

    Running on an iOS device or in simulator gives the black screen and in the logs there is only a message like:

    Finished load of: file:///var/containers/Bundle/Application/3D48F237-F760-4F33-A08E-4A113A576B05/testapp2.app/www/index.html[/code:2wc8fnyc]
    
    Running on an iOS 9.3 device it still works as expected.
    
    Further, building the app with a simple non-C2 web app appears to launch as expected on device and in the simulator.
    
    I found suggestions of adding an appropriate Content-Security-Policy tag to index.html, and have tried this with no success.  What other configuration might be necessary to get the game to run on iOS 10, that I could have overlooked and was not strictly necessary on iOS 9?
  • I am having the exact same issue and my app is for sale. I just started over as well. My app worked fine as well before. It is a $.99 app, so this is very challenging. I may have to pull it.

  • Another update. I did as you did with a different app. I built an old impactJs project I had from years ago and it runs fine on Cordova/OSX 10.

    This seems isolated to construct2 exports for Cordova based on the cordova apps that i have.

  • Give this a try > http://stackoverflow.com/questions/3841 ... os-10-beta < -- I've searched various forums, including the Cordova project, and am not finding anything specific, other than the link that I just gave you which recommends an update to the CSP tag in your index.html file. Also, this response on the PhoneGap Build forum > https://forums.adobe.com/message/8985487#8985487 < from "kerrishotts" has some useful info.

  • I am having same problem. My game on the app store stops working if the player upgrades to iOS 10. I also tried adding the CSP tag with no luck. Hope this is resolved ASAP or I just may move to Cocoon.io as many others have.

  • I'd already seen the recommendation to add the CSP tag but it did not help. Also, it's not necessary to get non-C2 apps to launch.

  • I've made a little progress. I moved some of the settings from the config.xml file to the platform/ios/app/config.xml file but kept the intent tags. The app does load now.

    I did not add the CSP tag to index.html. I basically just merged the config.xml files. I don't know exactly what should be happening there, but without the content in both of those files, the app will not start.

    Below is what it looks like. I know the general intent with wild card is very open, but I am just trying to get this going right now.

    I'll post more as I get to everything working.

    (working config posted below)[/code:4gqyjg9c]
  • Where is platform/ios/app/config.xml? Thanks.

  • I am not 100% sure if the config.xml files get combined when building. So, I just took the contents from the config.xml file that Construct2 creates and put them into the config.xml file that cordova creates when generating the app. I think all of these settings need to be in the same file.

    Thats the file you are asking about. In the cordova project, it is just one level above the www folder. So it would be :

    [app folder]\config.xml

    [app folder]\www

    [app folder]\platforms

    etc

    I just put all of the configs in the config.xml at the top level. When building cordova will pull in all of the plug ins that you need. Below is what my file looks like. There were several things that I needed because of the the plugins I have and things that are needed. It is not recommended to have the intent entries with the wildcard, but I'm just getting this working again. This does work without any changes in the construct.

    Its just combining the export config from construct with the config that cordova creates. Putting the security policy entry in the index.html file actually prevented the app from working . I did try that with wide open options. This is just what I've found. I'm not a cordova expert but at least its up and running again.

    config.xml

    <?xml version='1.0' encoding='utf-8'?>
    
    <widget id="com.rggames.mathfactchallenger" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
        
        <name>MathFactChallenger</name>
        <description>
            Math Fact Challenger - practice math facts!
        </description>
        <author email="ryan@mathfactgames.net"
            href="http://mathfactgames.net">
            Math Fact Games
        </author>
        <plugin name="cordova-plugin-whitelist" source="npm" />
        <access origin="*" />
        <allow-intent href="*" />
        <allow-navigation href="*" />
    
        <preference name="orientation" value="default" />
        <preference name="fullscreen" value="true" />
        <gap:config-file platform="ios" parent="UIStatusBarHidden"><true/></gap:config-file>
        <gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance"><false/></gap:config-file>
        <preference name="AllowInlineMediaPlayback" value="true"/>
        <preference name="BackupWebStorage" value="local"/>
        <preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" />
       
        
        <plugin name="cordova-plugin-wkwebview-engine" source="npm"/>
        <plugin name="cordova-plugin-file" source="npm" />
        <plugin name="cordova-plugin-media" source="npm" />
        <plugin name="cordova-plugin-inappbrowser" source="npm" />
        <plugin name="cordova-plugin-canvas2image" source="npm" />
        
        
    </widget>
    [/code:7zk48j4c]
  • Are you editing files before or after "cordova prepare ios"? Which line(s) in your config.xml above made the difference?

  • Before. I am not using prepare, just building from the command line first, then run/rebuild with xcode 8.

    Every time I changed the config.xml, I ran

    cordova clean
    cordova build ios[/code:d11cr2hd]
    Then run in simulator.
    
    As far as I could tell, all of the records were needed due to the requirements of my app.  I expect that the start up issue is resolved by :
    [code:d11cr2hd]
    <plugin name="cordova-plugin-whitelist" source="npm" />
        <access origin="*" />
        <allow-intent href="*" />
        <allow-navigation href="*" />[/code:d11cr2hd]
    I think instead of using wildcard "*", it could  be "self" instead.   If your app has any chance of running outside code, you would want to limit that down.  My app does not have any external integration at all.   
    
    I literally took every cordova provided config.xml setting that I could find, put in the file and then backed out until I got to what was needed since I don't see any documentation regarding this and iOS10.   
    
    also these became necessary for "downstream" errors after the startup [code:d11cr2hd]
        <preference name="AllowInlineMediaPlayback" value="true"/>
        <preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" />[/code:d11cr2hd]
    and these plug ins [code:d11cr2hd]    
        <plugin name="cordova-plugin-wkwebview-engine" source="npm"/>
        <plugin name="cordova-plugin-file" source="npm" />
        <plugin name="cordova-plugin-media" source="npm" />[/code:d11cr2hd]
    
    In the end, I just took the project related construct 2 created items from the construct created config.xml and put them into the cordova created xml.  I expect that it could be done the other way (take the cordova created items and move to the construct created file).  I think if the project level comfig.xml file as gone and the config.xml that construct creates has everything included, it will work.  I just didn't have time or energy to test that out.  
    
    Another thing I did along the way because some of these base plugins had a lot of warnings in xcode, I ran cordova platform update to be sure all of that is current.  I think there were still about 7 warnings from inAppBrowser and Canvas2Image to fix.  But, those don't affect the running of the app.  
    
    Do you have two config.xml files in the project structure?  One at the root and then one in the www folder that copies out of the construct build?
    
    Going forward, ideally the construct2 export would include the security settings needed for the construct2 provided plugins and options in the config.xml file.  Then we could just use that file.  It's just unfortunate that these settings became required by iOS10 and nobody knew ahead of time.
  • What do you mean by config files get combined? When I deploy from C2, there is a config.xml file under the www folder. There is also one in the directory above www that does not seem to be updating so I assume this is from me exporting in the old format at some point. Are you saying i need to copy the file from the www folder to the root? Also, are you putting '*' in the Intent and Navigation boxes?

    I am not having any success trying different things. Any help is greatly appreciated!

  • Thats what I did. I basically used the new config file from the test project that I created. I did this after upgrading xCode to 8 and verifying the cordova was at the lastest version. Also ran cordova platform update.

    I then took that config.xml file and put it in my "old project". I didn't want to start over with the assets, plist items, etc. I then took the necessary records from my config.xml that came from Construct2. Basically that was just the plugins and a couple gap settings. I put those in the project level config.xml.

    I then just removed the settings from the new file that aren't needed to remove any variables. For me, that was settings related to android/crosswalk as I'm not dealing with Android just yet. I then deleted the config.xml file that came with the construct export from the www folder. It is not complete from that export and I don't think it really gets hit when there is the project level config file there already. That is where I thought it would be great if Construct2 could add the settings that are now required for iOS10 to the config.xml export. Then that file would out of Construct would be usable. I'd just move it to the project level on each update.

    From there it was just a matter of cordova clean and cordova build ios then simulate in xcode. All worked. That was a relief! Now it is the wait for Apple to take their time approving the fact that the application now starts up correctly.

    Yes, i put * for those setting so that I was sure that I was giving it every option. Those entries are there with the cordova template, but they are not set as *. It would probably work more limited scope, but I was going on 13 hours and just needed to get it going. The config file that I posted is complete and it is what I am using right now. The www/config.xml is deleted and when I do a new import, I don't copy that file in. I may just add new settings if there are any (until Construct2 provides a compete config.xml for Cordova).

    If you want to send your files, I could show you what I did using them. I went around and around with these for awhile as I never really paid much attention to them before. This should eventually get resolved in a better way , but since your app is dead, waiting isn't really an option.

  • I got my game loading again by simply creating a new project in XDK. Ads are not displaying so I will work on that now, but I wanted to let you know.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Good to know!

    Thanks.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)