21 Replies Latest reply on Jan 6, 2017 10:20 AM by kerrishotts

    config.xml break my app

    aloxord

      Hello! I have a phonegap app where I need to be forced to look upright, and I did! But a few weeks ago, I started to malfunction and after many laps I discovered that removing the config.xml worked, my phonegap version is the last, the id is 2416744, and the content of config.xml:

       

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

      <widget xmlns      ="http://www.w3.org/ns/widgets"

              xmlns:gap  ="http://phonegap.com/ns/1.0"

              id         ="com.XXX.XXX"

              version    ="0.0.1">

          <name>XXX</name>

       

       

              <description>App</description>

          <author email="XXX" href="XXX">

              XXX

          </author>

          <content src="index.html" />

          <preference name="DisallowOverscroll" value="true" />

          <preference name="orientation" value="portrait" />

           <preference name="EnableViewportScale" value="true" />

          <icon src="res/android/icon.jpg" />

          <plugin name="underscore" source="npm" />

          <access origin="*" />

          <allow-intent href="http://*/*" />

          <allow-intent href="https://*/*" />

          <allow-intent href="tel:*" />

          <allow-intent href="sms:*" />

          <allow-intent href="mailto:*" />

          <allow-intent href="geo:*" />

          <platform name="android">

              <allow-intent href="market:*" />

          </platform>

      </widget>

       

      Message was edited by: Kerri Shotts Removed identifying information as requested by OP.

        • 1. Re: config.xml break my app
          VectorP Level 4

          I assume that you are testing on Android, only (given your config).

           

          Here is some feedback on your config:

           

          1. <icon src="res/android/icon.jpg" />

          The default icon should be a .png file, be located in the root and be called 'icon.png'

          See Icons and Splash | PhoneGap Docs

           

          2. <plugin name="underscore" source="npm" />

          I am not quite sure whether or not this is a plugin at all. AFAIK, it's a javascript library called 'underscore.js'

           

          3. Whitelist rules

          Your whitelist rules will not be obeyed, since the whitelist plugin is missing.

           

          4. Splashes

          You have no splashscreen images and no splashscreen plugin. I recommend adding them.

          • 2. Re: config.xml break my app
            aloxord Level 1

            hi! thanks VectorP! i fix that you are pointing, but the problem is there yet, sorry for the english... my actual config.xml:

             

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

               <widget xmlns      ="http://www.w3.org/ns/widgets"

                       xmlns:gap  ="http://phonegap.com/ns/1.0"

                       id         ="com.XXX.XXX"

                       version    ="0.0.1">

                   <name>XXX</name>

                       <description>App</description>

                   <author email="XXX" href="XXXhttp://phanta-soft.com/">

                       XXX

                  </author>

                  <content src="index.html" />

                  <preference name="orientation" value="portrait" />

                  <preference name="SplashScreen" value="screen" />

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

                  <preference name="cordova-plugin-whitelist" source="npm"/>

                  <splash src="splash.png"/>

                  <icon src="icon.png" />

               </widget>

             

             

            Mod note: edited to remove identifying information

            • 3. Re: config.xml break my app
              kerrishotts Adobe Community Professional
              • That is not how you include the Whitelist or Splash Screen plugins. Use the <plugin> tag instead.
              • You've not included any access, allow-navigation, or allow-intent tags. See the white listing documentation: Whitelist - Apache Cordova
              • Be more specific about how your app "malfunctions" when config.xml is supplied.
                • Your code might be breaking due to a newer PGB CLI release. See https://build.phonegap.com/current-support
                • But without more information about how your app is broken, we're just guessing here, and will be of little help.
              • See Asking Better Questions (PhoneGap Forum) for information that is useful to us in helping you (such as devices you're testing on, platforms you're using [and versions], etc.)
              • 4. Re: config.xml break my app
                aloxord Level 1

                sorry! the error happens when i start the app, in the hydration screen says: "Whoops, looks like an error occured", this had happened to me before with javascript errors, but this time works great if i delete the config.xml, nothing works with my config.xml, new version and still not working:

                 

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

                   <widget xmlns      ="http://www.w3.org/ns/widgets"

                           xmlns:gap  ="http://phonegap.com/ns/1.0"

                           id         ="com.XXX.XXX"

                           version    ="0.0.1">

                       <name>XXX</name>

                           <description>XXX</description>

                       <author email="XXX" href="XXX">

                           XXX

                      </author>

                      <content src="index.html" />

                      <preference name="orientation" value="portrait" />

                      <preference name="SplashScreen" value="screen" />

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

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

                      <splash src="splash.png"/>

                      <icon src="icon.png" />

                   </widget>

                 

                Mod note: edited to remove identifying information

                • 5. Re: config.xml break my app
                  aloxord Level 1

                  oh! i remove the plugin "whitelist"

                  • 6. Re: config.xml break my app
                    kerrishotts Adobe Community Professional

                    If you make changes in your config.xml file for a hydrated app, you need to uninstall the app from your device and reinstall it. Hydration applies only to web content (JS, HTML, CSS), not to plugins, config.xml configuration settings, etc.

                    1 person found this helpful
                    • 7. Re: config.xml break my app
                      aloxord Level 1

                      And that I always do, until the cache is clean ...

                      • 8. Re: config.xml break my app
                        kerrishotts Adobe Community Professional

                        Try disabling hydration (rebuild, uninstall and reinstall) and see if your app works. If it does, then try reenabling hydration and see if the problem persists.

                        1 person found this helpful
                        • 9. Re: config.xml break my app
                          aloxord Level 1

                          its ok without the hydration... but i need that! omg...

                          • 10. Re: config.xml break my app
                            aloxord Level 1

                            "whoops, looks like an error occured",

                             

                            logs:

                            12-28 16:21:01.725 11481 11481 I chromium: [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token L", source: file:///data/user/0/XXX/files/downloads/app_dir/index.html (1)

                            [15:21:34] gnualmafuerte: 12-28 16:21:01.439 11481 11518 D AppLoader: Loading /data/user/0/XXX/files/downloads/app_dir/index.html

                            12-28 16:21:01.455 11481 11481 D JsMessageQueue: Set native->JS mode to null

                            12-28 16:21:01.491 11481 11481 W BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 11481

                            12-28 16:21:01.535 11481 11481 D JsMessageQueue: Set native->JS mode to OnlineEventsBridgeMode

                            12-28 16:21:01.560 11481 11481 I chromium: [INFO:CONSOLE(1)] "loading require.js", source: file:///data/user/0/XXX/files/downloads/app_dir/require-1.0.8.js (1)

                            12-28 16:21:01.565 11481 11481 I chromium: [INFO:CONSOLE(1960)] "load = main", source: file:///data/user/0/XXX/files/downloads/app_dir/require-1.0.8.js (1960)

                            12-28 16:21:01.641 11481 11518 D CordovaNetworkManager: Connection Type: wifi

                            12-28 16:21:01.641 11481 11481 D CordovaNetworkManager: Connection Type: wifi

                            12-28 16:21:01.641 11481 11481 D CordovaNetworkManager: Connection Extra Info: "DiosNoExiste"

                            12-28 16:21:01.641 11481 11518 D CordovaNetworkManager: Connection Extra Info: "DiosNoExiste"

                            12-28 16:21:01.661 11481 11481 I chromium: [INFO:CONSOLE(1)] "loading zepto.js", source: file:///data/user/0/XXX/files/downloads/app_dir/zepto.js (1)

                            12-28 16:21:01.670 11481 11481 I chromium: [INFO:CONSOLE(1)] "loading lawnchair.js", source: file:///data/user/0/XXXX/files/downloads/app_dir/lawnchair.js (1)

                            12-28 16:21:01.719 11481 11481 I chromium: [INFO:CONSOLE(1634)] "Uncaught Error: Module name 'underscore' has not been loaded yet for context: _

                            12-28 16:21:01.719 11481 11481 I chromium: http://requirejs.org/docs/errors.html#notloaded", source: file:///data/user/0/XXX/files/downloads/app_dir/require-1.0.8.js (1634)

                            12-28 16:21:01.721 11481 11481 I chromium: [INFO:CONSOLE(4)] "Uncaught ReferenceError: _ is not defined", source: file:///data/user/0/XXX/files/downloads/app_dir/backbone.js (4)

                            12-28 16:21:01.723 11599 11691 I GlobalDismissManager: no sender configured

                            12-28 16:21:01.724 11599 11691 D AlertService: Beginning updateAlertNotification

                            12-28 16:21:01.725 11481 11481 I chromium: [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token L", source: file:///data/user/0/XXX/files/downloads/app_dir/index.html (1)

                            12-28 16:21:01.737 11599 11691 D AlertService: No fired or scheduled alerts

                            12-28 16:21:01.747 11599 11691 D AlertService: Scheduling next alarm with AlarmScheduler. sEventReminderReceived: null

                            12-28 16:21:01.772 11599 11691 D AlarmScheduler: No events found starting within 1 week.

                            12-28 16:21:01.781 11481 11481 I chromium: [INFO:CONSOLE(1)] "adding homepage.js", source:  (1)

                             

                            Mod note: edited to remove identifying information

                            • 11. Re: config.xml break my app
                              aloxord Level 1

                              logs are courtesy of logcat

                              • 12. Re: config.xml break my app
                                VectorP Level 4

                                its ok without the hydration... but i need that! omg...

                                You need Hydration, even when changing your config?

                                Can't you ask your testers to install the latest test version of the app manually, only for those few times you change your config.xml?

                                • 13. Re: config.xml break my app
                                  aloxord Level 1

                                  the app needs to change the information when it have some new... that i do with the hydration, to reload the html with the new things

                                  • 14. Re: config.xml break my app
                                    kerrishotts Adobe Community Professional

                                    OK -- let me get this straight -- the app works without hydration now. If you re-enable hydration, it breaks with the error log you posted?

                                    • 16. Re: config.xml break my app
                                      kerrishotts Adobe Community Professional

                                      It's possible there's an issue with hydration in this case. BUT, double check all your files and make sure they are in the expected encoding and that there aren't any spurious BOMs around. I don't know why I'm thinking about encodings here, but who knows.

                                       

                                      Also, hydration isn't the only option here. There are lots of similar utilities out there. I've heard lots of good things about Microsoft Code Push: https://microsoft.github.io/code-push/

                                      1 person found this helpful
                                      • 17. Re: config.xml break my app
                                        aloxord Level 1

                                        yeah... i think that the hydration is the problem! Oh! thats that i need! alternatives to this service

                                        • 18. Re: config.xml break my app
                                          aloxord Level 1

                                          i need to delete this post! please help.

                                          • 19. Re: config.xml break my app
                                            kerrishotts Adobe Community Professional

                                            What, specifically, do you need to delete? why?

                                            • 20. Re: config.xml break my app
                                              aloxord Level 1

                                              The best would be to edit the original question and remove the clients' names, which is where it says "XXX ..." and "XXX ...", but I think I can not do it, so I'd like to delete the whole post, Before I happen to be a problem in my work, by the way, the error of hydration is by a require 1.xy bug and replace it

                                               

                                              Mod note: edited to remove identifying information

                                              • 21. Re: config.xml break my app
                                                kerrishotts Adobe Community Professional

                                                I've removed the identifying information. Let me know if I missed anything.