6 Replies Latest reply on Mar 27, 2017 7:43 AM by kerrishotts

    Extremely slow on iOS

    byronigoe Level 1

      On Sept 26, 2016 I built a new version of my app with 6.3.0, everything was fine, and I published it to both the Apple and Google App Stores.

       

      I did quite a bit of development, and built a new version today with 6.5.0. It works great on Android, but is ridiculously slow (20x) on an iPhone. It is not just slow to initially load, but always slow doing any operation in the app. It's as if something is occupying the CPU.

       

      I know how to do a differential diagnosis. I am able to install the App Store version on the same iPhone, and it is fast. I checked out my Sept 26 code from version control (including a roll back of my config.xml to use 6.3.0). This "new" build should be exactly the same as the one that is accessible from the App Store, but it still runs extremely slow (20x) only on iOS. The only remaining variable is PhoneGap Build.

       

      The app is free from the App Store, and I can provide the latest build too. Thus anyone should be able to reproduce this problem. Any help is appreciated.

        • 1. Re: Extremely slow on iOS
          kerrishotts Adobe Community Professional

          Care to share your app name? Also, post a link to your config.xml (redacting private/sensitive information).

           

          Please be more specific as to what version(s) of iOS you're testing on and what devices you've tried. Because "slow" has so many different connotations in the hybrid world, a video of the before & after wouldn't hurt either.

          • 2. Re: Extremely slow on iOS
            byronigoe Level 1

            The app is "Gunks+". Here is the config.xml:

            <?xml version='1.0' encoding='utf-8'?>

            <widget id="com.gunksapps.gunks" version="2.7" android-versionCode="7441" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android">

                <name>Gunks+</name>

                <description>

                    Gunks rock climbing and bouldering guidebook

                </description>

                <author email="dirtbagdevelopers@gmail.com" href="http://gunksapps.com">

                    Dirtbag Developers

                </author>

                <content src="index.html" />

                <access origin="*" />

              <icon src="icon.png" width="512" height="512" />

              <icon src="icon29.png" gap:platform="ios" width="29" height="29" />

              <icon src="icon57.png" gap:platform="ios" width="57" height="57" />

              <icon src="icon72.png" gap:platform="ios" width="72" height="72" />

              <icon src="icon76.png" gap:platform="ios" width="76" height="76" />

              <icon src="icon120.png" gap:platform="ios" width="120" height="120" />

              <icon src="icon152.png" gap:platform="ios" width="152" height="152" />

              <icon src="icon167.png" gap:platform="ios" width="167" height="167" />

             

             

              <preference name="phonegap-version" value="cli-6.3.0" />

              <preference name="AndroidPersistentFileLocation" value="Internal" />

              <preference name="iosPersistentFileLocation" value="Library" />

              <preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root"/>

              <preference name="BackupWebStorage" value="none" />

             

             

              <gap:platform name="ios" />

              <gap:platform name="android" />

             

             

              <gap:plugin name="cordova-plugin-device" source="npm" version="1.1.2" />

              <gap:plugin name="cordova-plugin-device-orientation" source="npm" version="1.0.4" />

              <gap:plugin name="cordova-plugin-dialogs" source="npm" version="1.2.1" />

              <gap:plugin name="cordova-plugin-file" source="npm" version="4.2.0" />

              <gap:plugin name="cordova-plugin-file-transfer" source="npm" version="1.5.1" />

              <!-- <gap:plugin name="org.apache.cordova.geolocation" source="pgb" version="0.3.12" /> -->

              <gap:plugin name="cordova-plugin-geolocation" source="npm" version="2.3.0" />

              <gap:plugin name="cordova-plugin-inappbrowser" source="npm" version="1.4.0" />

              <gap:plugin name="cordova-plugin-splashscreen" source="npm" version="3.2.2" />

              <gap:plugin name="cordova-plugin-statusbar" source="npm" version="2.1.3" />

              <gap:plugin name="cordova-plugin-transport-security" source="npm" version="0.1.2" />

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

              <gap:plugin name="cordova-plugin-customurlscheme" source="npm" version="4.2.0">

              <param name="URL_SCHEME" value="gunks" />

              </gap:plugin>

             

             

              <gap:config-file platform="android" parent="/manifest">

              <application android:theme="@android:style/Theme.NoTitleBar"></application>

              </gap:config-file>

             

             

              <preference name="StatusBarOverlaysWebView" value="false" />

              <preference name="StatusBarStyle" value="lightcontent" />

              <preference name="StatusBarBackgroundColor" value="#000000" />

             

             

              <gap:splash src="splash.png" />

              <!-- iPhone and iPod touch -->

              <!--

              <gap:splash src="Default.png" gap:platform="ios" width="320" height="480" />

              -->

              <gap:splash src="Default@2x.png" gap:platform="ios" width="640" height="960" />

             

             

              <!-- iPhone 5 / iPod Touch (5th Generation) -->

              <gap:splash src="Default-568h@2x.png" gap:platform="ios" width="640" height="1136" />

             

             

              <!-- iPhone 6 -->

              <gap:splash src="Default-667h@2x.png" gap:platform="ios" width="750" height="1334" />

              <!--

              <gap:splash src="Default-Portrait-736h@3x.png" gap:platform="ios" width="1242" height="2208" />

              <gap:splash src="Default-Landscape-736h@3x.png" gap:platform="ios" width="2208" height="1242" />

              -->

              <!-- iPad -->

              <!--

              <gap:splash src="Default-Portrait.png" gap:platform="ios" width="768" height="1024" />

              <gap:splash src="Default-Landscape.png" gap:platform="ios" width="1024" height="768" />

              -->

              <!-- Retina iPad -->

              <gap:splash src="Default-Portrait@2x.png" gap:platform="ios" width="1536" height="2048" />

              <!--

              <gap:splash src="Default-Landscape@2x.png" gap:platform="ios" width="2048" height="1536" />

              -->

              <gap:splash src="Default-568h@2x.png" gap:platform="android" />

              <!--

              <gap:splash src="mdpi.png" gap:platform="android" gap:qualifier="mdpi" />

              <gap:splash src="hdpi.png" gap:platform="android" gap:qualifier="hdpi" />

              <gap:splash src="xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" />

              <gap:splash src="portrait-xxhdpi.png" gap:platform="android" gap:qualifier="port-xxhdpi" />

              <gap:splash src="landscape-xxhdpi.png" gap:platform="android" gap:qualifier="land-xxhdpi" />

              -->

            </widget>

            • 3. Re: Extremely slow on iOS
              byronigoe Level 1

              The test device that exhibits the slow behavior is an iPhone 6 running iOS 10.3. As I mentioned, the App Store build uses the same code and the same config.xml, and is not slow on the same device. On that same device, the difference between slow and not slow is 20x.

               

              I am also able to test on an iPad running iOS 9.x and the new build is fast.

               

              I will try to find another iPhone running 10.3 to see if it can reproduce the problem.

              • 4. Re: Extremely slow on iOS
                byronigoe Level 1

                I got another test phone (iPhone 6+) which is also running iOS 10, and it is also ridiculously slow the entire time running a development build. To be clear, when I say "fast" I mean response time of 1-3 seconds, and when I say "slow" I mean response time of 30-70 seconds for every operation. It is unusable.

                 

                The iPad running the same development build has iOS 9.2.1 and is fast.

                 

                To summarize, there are 2 dimensions: dev build vs release build; and iOS 9 vs iOS 10. The only combination that results in slow behavior is dev build & iOS 10. All other permutations are fast. Every other difference, e.g. code & phonegap CLI version have been controlled.

                 

                In case it matters, my app is using AngularJS 1.4.10

                • 5. Re: Extremely slow on iOS
                  byronigoe Level 1

                  As of iOS 10, the Content Security Policy needs to explicitly permit gap://ready and file:

                  The complete META tag should be something like:

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

                   

                  Why did this problem cause slow behavior instead of loss of functionality? I have no idea.

                   

                  Why does the existing published version in the App Store, which is missing these CSP items, function normally? I can only assume that Apple realized their change in requirements would break a bunch of existing apps, and grandfathered them in with some special logic.

                  • 6. Re: Extremely slow on iOS
                    kerrishotts Adobe Community Professional

                    Glad you got it working. I wouldn't have expected to see that kind of behavior from an incorrect CSP; rather that usually manifests itself as a complete failure. Strange.

                     

                    Something to watch out for in the future, that's for sure.