11 Replies Latest reply on Sep 8, 2016 5:59 AM by VectorP

    build.phonegap is buggy or something

    carlosg50568814

      Trying to build my project (Android & iOS) without success, hang on splash screen and do nothing.

       

      in iOS log I found this relevant:

       

       

      2016-09-06 06:13:49.110 Interface Builder Cocoa Touch Tool[45495:19269516] CoreUI: CUICatalog: couldn't get 'kMGArtworkGraphicsFeatureSetFallbacks' from MGCopyAnswer got '{     ArtworkDeviceIdiom = pad;     ArtworkDeviceScaleFactor = "-1";     DevicePerformanceMemoryClass = 1; }'

      /project/Intooapps/Plugins/cordova-plugin-barcodescanner/zxing-all-in-one.cpp:2085:15: warning: implicit conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]     int max = points.size();



      Android log show everything fine, but still won't work.

      I also have cordova CLI in my local pc, I had compiled for android and work 100% good.

       

      I also tried setting differents build version:

       

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

       

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

       

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

       

      kMGArtworkGraphicsFeatureSetFallback
        • 1. Re: build.phonegap is buggy or something
          VectorP Level 4

          That plugin was updated 501 days ago!

          Would you try phonegap-plugin-barcodescanner  instead?

          • 2. Re: build.phonegap is buggy or something
            carlosg50568814 Level 1

            I removed that plugin from my app and still the same problem.

            hang on splash screen and do nothing

            • 3. Re: build.phonegap is buggy or something
              VectorP Level 4

              OK. Several possibilities:

              - wrong splashscreen handling due to:

              a. missing splashscreen plugin

              b. missing splashscreen hide logic

              c. wrong splashscreen config settings

              - wrong index.html logic (not waiting for deviceready event)

               

              Can you confirm that you have both index.html and config.xml in the root directory of your zip?

              Can you confirm that you have the splashscreen plugin included? If so, from where and which version?

              Can you confirm that you have specified that the splash has to disappear automatically?

              If you are loading content using ajax, can you confirm that you are waiting for deviceready before attempting to make that ajax request?

              • 4. Re: build.phonegap is buggy or something
                carlosg50568814 Level 1

                Hi, thank for you reply, here my splash screen setting, I think the problem came form the build on phonegap, because I can compile fine using cordova CLI in my local pc.

                 

                - wrong splashscreen handling due to:

                a. missing splashscreen plugin

                <plugin name="cordova-plugin-splashscreen" source="npm" />

                 

                <preference name="AutoHideSplashScreen" value="false" />
                <preference name="SplashScreen" value="screen" />
                <preference name="SplashScreenDelay" value="60000" />

                 

                 

                b. missing splashscreen hide logic

                c. wrong splashscreen config settings

                - wrong index.html logic (not waiting for deviceready event)

                 

                    $ionicPlatform.ready(function() {

                        // Wait 2secs before hiding splash screen

                        $timeout(function() {

                            try {

                                $cordovaSplashscreen.hide();

                                console.log('splash:hide');

                            } catch (err) {

                                console.log('NOT splash');

                            }

                        }, 2000);

                });

                • 5. Re: build.phonegap is buggy or something
                  VectorP Level 4

                  I think the problem came form the build on phonegap, because I can compile fine using cordova CLI in my local pc.

                  This usually means that you are uploading the wrong things to PGB.

                  1. Do you upload your assets and a config only, and not a full Cordova project?

                  2. Do you have both index.html and config.xml in the root directory of your zip file?

                  3. If you're including external libraries, such as Ionic, did you whitelist those resources properly?

                  • 6. Re: build.phonegap is buggy or something
                    carlosg50568814 Level 1

                    1- Yes

                    2 Yes

                    I had like 2 years working with phonegap and cordova CLI so I know how must be used.

                     

                    I really needs to build on phonegap just to get iOS version, I can build android local with my pc.

                    • 7. Re: build.phonegap is buggy or something
                      VectorP Level 4

                      Could you please post your config.xml?

                      • 8. Re: build.phonegap is buggy or something
                        carlosg50568814 Level 1

                        I found the problem,

                        apparently you can't have more than 1 file named "index.html" on your project.

                        example:

                         

                         

                        www/

                             orders/

                               payments.html

                               listing.html

                               index.html

                             customer/
                                  form.html
                                  index.html

                        index.html

                         

                         

                         

                        phonegap will pick 1st file occurrence named "index.html" in this case on /www/orders/index.html and no the correct one www/index.html also ignoring this setting in config.xml

                         

                        <content src="./index.html" />

                        • 9. Re: build.phonegap is buggy or something
                          kerrishotts Adobe Community Professional

                          Yeah; PGB is trying to be helpful there, and in this case, guessing incorrectly. PGB will try to infer your project structure to a degree, based on where index.html is located, and since you've got multiples and a www directory, it picks the wrong one.

                           

                          Side note: Is your app a Single Page App (SPA) and using the additional .html files as templates? If not, I highly suggest you look at architecting your app as a SPA.

                          • 10. Re: build.phonegap is buggy or something
                            carlosg50568814 Level 1

                            yes is a SPA app. I'm using ionic + angular.

                            But this issues only happens when I build with phonegap cloud and not with cordova CLI.

                            So I think this is a bug because compiler must respect what was settings on <content src="./index.html" />

                            • 11. Re: build.phonegap is buggy or something
                              VectorP Level 4

                              It's not a bug.

                              The content element in the config is not related to the spot where the config.xml is to be found.

                              (After all, PGB must find that config.xml first, before being able to read what the content element's value is).

                               

                              The current PGB documentation doesn't even mention the content element, but the Cordova documentation does. It says:

                              Content - Defines the app's starting page in the top-level web assets directory. The default value is index.html, which customarily appears in a project's top-level www directory.

                               

                              PGB will look for your index.html and expects a config in the same directory.

                              So, your best bet is to have both index.html and config.xml in the root directory of your zip file and to make sure that only one index.html is present in your assets.