12 Replies Latest reply on Nov 18, 2016 5:13 AM by savantripathi

    There is a network error by clicking dynamic linked menu icon


          Dear sir/Mam,


      CUrrently I am new to Hybrid application development and i have started with adobe phonegap framework.

      I have develop some web based features in html5 template with java script and css and used java based web services to connect to database (i.e PostgreSQL) which is located in amazon web services RDS service.

                I have installed phonegap and cordova in my laptop. I am creating new project by using command line and i am posting all my code in www folder as per reference i got from internet. Then finally i am zipping all files with index.html file as first and uploaded it to my adobe phonegap id and build it successfully. I got .apk and .xap files. I have successfully installed it in my mobile phone which is android smartphone with jellybean os.

                So my question is when i am running the application first page of index.html is viewed properly in mobile phonem, but as soon as i am clicking on another menu item which is redirecting to my server which is calling first webservices and then database, I am getting error of Network. and app is getting unfortunately stopped everytime. I have checked internet connection.

           I have also tried it in Samsung E7 mobile phone but in that phone i am not getting error but also not able to redirecting to another page. Menu click is not working in it.

           Web based module is working perfectely fine. so I am confused now what to do . Can you suggest me proper guidence for this problem? Or is there any complete reference with database for developing hybrid app from web based app.


      Here i am attaching screen shot of my mobile phone which shows the error.Screenshot_2016-11-16-18-45-11.png

        • 1. Re: There is a network error by clicking dynamic linked menu icon
          kerrishotts Adobe Employee

          Next to impossible to offer any help without seeing some code. Please share relevant snippets that reproduce the problem (minus secret/identifying information). Might also help to see your config.xml file and any CSP meta tag (content security policy).

          • 2. Re: There is a network error by clicking dynamic linked menu icon
            savantripathi Level 1

            ok Kerrishotts , here is my config.xml file.


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

            <widget id="com.phonegap.helloworld" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">

                <name>Hello World</name>


                    Hello World sample application that responds to the deviceready event.


                <author email="support@phonegap.com" href="http://phonegap.com">

                    PhoneGap Team


                <content src="index.html" />

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

                <preference name="android-minSdkVersion" value="14" />

                <plugin name="cordova-plugin-battery-status" source="npm" spec="~1.1.1" />

                <plugin name="cordova-plugin-camera" source="npm" spec="~2.1.1" />

                <plugin name="cordova-plugin-media-capture" source="npm" spec="~1.2.0" />

                <plugin name="cordova-plugin-console" source="npm" spec="~1.0.2" />

                <plugin name="cordova-plugin-contacts" source="npm" spec="~2.0.1" />

                <plugin name="cordova-plugin-device" source="npm" spec="~1.1.1" />

                <plugin name="cordova-plugin-device-motion" source="npm" spec="~1.2.0" />

                <plugin name="cordova-plugin-device-orientation" source="npm" spec="~1.0.2" />

                <plugin name="cordova-plugin-dialogs" source="npm" spec="~1.2.0" />

                <plugin name="cordova-plugin-file" source="npm" spec="~4.1.1" />

                <plugin name="cordova-plugin-file-transfer" source="npm" spec="~1.5.0" />

                <plugin name="cordova-plugin-geolocation" source="npm" spec="~2.1.0" />

                <plugin name="cordova-plugin-globalization" source="npm" spec="~1.0.3" />

                <plugin name="cordova-plugin-inappbrowser" source="npm" spec="~1.3.0" />

                <plugin name="cordova-plugin-media" source="npm" spec="~2.2.0" />

                <plugin name="cordova-plugin-network-information" source="npm" spec="~1.2.0" />

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

                <plugin name="cordova-plugin-statusbar" source="npm" spec="~2.1.2" />

                <plugin name="cordova-plugin-vibration" source="npm" spec="~2.1.0" />

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

                <plugin name="com.indigoway.cordova.whitelist.whitelistplugin" spec="1.1.1" source="pgb" />

                <icon src="icon.png" />

                <platform name="android">

                    <icon density="ldpi" src="www/res/icon/android/drawable-ldpi-icon.png" />

                    <icon density="mdpi" src="www/res/icon/android/drawable-mdpi-icon.png" />

                    <icon density="hdpi" src="www/res/icon/android/drawable-hdpi-icon.png" />

                    <icon density="xhdpi" src="www/res/icon/android/drawable-xhdpi-icon.png" />

                    <icon density="xxhdpi" src="www/res/icon/android/drawable-xxhdpi-icon.png" />

                    <icon density="xxxhdpi" src="www/res/icon/android/drawable-xxxhdpi-icon.png" />

                    <splash density="land-ldpi" src="www/res/screen/android/drawable-land-ldpi-screen.png" />

                    <splash density="land-mdpi" src="www/res/screen/android/drawable-land-mdpi-screen.png" />

                    <splash density="land-hdpi" src="www/res/screen/android/drawable-land-hdpi-screen.png" />

                    <splash density="land-xhdpi" src="www/res/screen/android/drawable-land-xhdpi-screen.png" />

                    <splash density="land-xxhdpi" src="www/res/screen/android/drawable-land-xxhdpi-screen.png" />

                    <splash density="land-xxxhdpi" src="www/res/screen/android/drawable-land-xxxhdpi-screen.png" />

                    <splash density="port-ldpi" src="www/res/screen/android/drawable-port-ldpi-screen.png" />

                    <splash density="port-mdpi" src="www/res/screen/android/drawable-port-mdpi-screen.png" />

                    <splash density="port-hdpi" src="www/res/screen/android/drawable-port-hdpi-screen.png" />

                    <splash density="port-xhdpi" src="www/res/screen/android/drawable-port-xhdpi-screen.png" />

                    <splash density="port-xxhdpi" src="www/res/screen/android/drawable-port-xxhdpi-screen.png" />

                    <splash density="port-xxxhdpi" src="www/res/screen/android/drawable-port-xxxhdpi-screen.png" />


                <platform name="ios">

                    <icon height="57" platform="ios" src="www/res/icon/ios/icon.png" width="57" />

                    <icon height="114" platform="ios" src="www/res/icon/ios/icon@2x.png" width="114" />

                    <icon height="40" platform="ios" src="www/res/icon/ios/icon-40.png" width="40" />

                    <icon height="80" platform="ios" src="www/res/icon/ios/icon-40@2x.png" width="80" />

                    <icon height="50" platform="ios" src="www/res/icon/ios/icon-50.png" width="50" />

                    <icon height="100" platform="ios" src="www/res/icon/ios/icon-50@2x.png" width="100" />

                    <icon height="60" platform="ios" src="www/res/icon/ios/icon-60.png" width="60" />

                    <icon height="120" platform="ios" src="www/res/icon/ios/icon-60@2x.png" width="120" />

                    <icon height="180" platform="ios" src="www/res/icon/ios/icon-60@3x.png" width="180" />

                    <icon height="72" platform="ios" src="www/res/icon/ios/icon-72.png" width="72" />

                    <icon height="144" platform="ios" src="www/res/icon/ios/icon-72@2x.png" width="144" />

                    <icon height="76" platform="ios" src="www/res/icon/ios/icon-76.png" width="76" />

                    <icon height="152" platform="ios" src="www/res/icon/ios/icon-76@2x.png" width="152" />

                    <icon height="29" platform="ios" src="www/res/icon/ios/icon-small.png" width="29" />

                    <icon height="58" platform="ios" src="www/res/icon/ios/icon-small@2x.png" width="58" />

                    <icon height="87" platform="ios" src="www/res/icon/ios/icon-small@3x.png" width="87" />

                    <splash height="1136" platform="ios" src="www/res/screen/ios/Default-568h@2x~iphone.png" width="640" />

                    <splash height="1334" platform="ios" src="www/res/screen/ios/Default-667h.png" width="750" />

                    <splash height="2208" platform="ios" src="www/res/screen/ios/Default-736h.png" width="1242" />

                    <splash height="1242" platform="ios" src="www/res/screen/ios/Default-Landscape-736h.png" width="2208" />

                    <splash height="1536" platform="ios" src="www/res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" />

                    <splash height="768" platform="ios" src="www/res/screen/ios/Default-Landscape~ipad.png" width="1024" />

                    <splash height="2048" platform="ios" src="www/res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" />

                    <splash height="1024" platform="ios" src="www/res/screen/ios/Default-Portrait~ipad.png" width="768" />

                    <splash height="960" platform="ios" src="www/res/screen/ios/Default@2x~iphone.png" width="640" />

                    <splash height="480" platform="ios" src="www/res/screen/ios/Default~iphone.png" width="320" />


                <platform name="wp8">

                    <icon height="99" platform="wp8" src="www/res/icon/wp8/ApplicationIcon.png" width="99" />

                    <icon height="159" platform="wp8" src="www/res/icon/wp8/Background.png" width="159" />

                    <splash height="1280" platform="wp8" src="www/res/screen/wp8/screen-portrait.jpg" width="768" />


                <platform name="windows">

                    <icon height="150" platform="windows" src="www/res/icon/windows/Square150x150Logo.scale-100.png" width="150" />

                    <icon height="30" platform="windows" src="www/res/icon/windows/Square30x30Logo.scale-100.png" width="30" />

                    <icon height="50" platform="windows" src="www/res/icon/windows/StoreLogo.scale-100.png" width="50" />

                    <splash height="300" platform="windows" src="www/res/screen/windows/SplashScreen.scale-100.png" width="620" />

                    <icon height="120" platform="windows" src="www/res/icon/windows/StoreLogo.scale-240.png" width="120" />

                    <icon height="44" platform="windows" src="www/res/icon/windows/Square44x44Logo.scale-100.png" width="44" />

                    <icon height="106" platform="windows" src="www/res/icon/windows/Square44x44Logo.scale-240.png" width="106" />

                    <icon height="70" platform="windows" src="www/res/icon/windows/Square70x70Logo.scale-100.png" width="70" />

                    <icon height="71" platform="windows" src="www/res/icon/windows/Square71x71Logo.scale-100.png" width="71" />

                    <icon height="170" platform="windows" src="www/res/icon/windows/Square71x71Logo.scale-240.png" width="170" />

                    <icon height="360" platform="windows" src="www/res/icon/windows/Square150x150Logo.scale-240.png" width="360" />

                    <icon height="310" platform="windows" src="www/res/icon/windows/Square310x310Logo.scale-100.png" width="310" />

                    <icon height="150" platform="windows" src="www/res/icon/windows/Wide310x150Logo.scale-100.png" width="310" />

                    <icon height="360" platform="windows" src="www/res/icon/windows/Wide310x150Logo.scale-240.png" width="744" />

                    <splash height="1920" platform="windows" src="www/res/screen/windows/SplashScreenPhone.scale-240.png" width="1152" />


                <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 name="ios">

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

                    <allow-intent href="itms-apps:*" />



            • 3. Re: There is a network error by clicking dynamic linked menu icon
              VectorP Level 4

              Did you include php scripts in your app's assets?


              Btw: your android splashes won't show, because you have compound qualifiers in the density attribute. Use the qualifier attribute instead.

              • 4. Re: There is a network error by clicking dynamic linked menu icon
                savantripathi Level 1

                I have put .php web service files parallel to .html files . so will it be work?? or shall i put it different folder?

                • 5. Re: There is a network error by clicking dynamic linked menu icon
                  VectorP Level 4

                  Won't "work" at all. Your app is a client, not a server with a PHP engine.

                  Your web service should be on a server, of course. Use ajax/xhr to make requests from the client.

                  • 6. Re: There is a network error by clicking dynamic linked menu icon
                    savantripathi Level 1

                    VectorP Sir, I am just trying with a single .php file to put it into www asset folder, But actually my all files are located on server. And I am able to run it direct from any browser and working fine. I am also able to run it with my module which is designed in HTML5 and working well with browser. But can't be able to solve it in mobile.

                    • 7. Re: There is a network error by clicking dynamic linked menu icon
                      VectorP Level 4

                      You can't include PHP scripts in your app's assets, because the devices will not run a web server with a php engine (unless such server/egine is installed by the user).

                      You should reconsider your application architecture and host your web service script on a server, not in the client.

                      • 8. Re: There is a network error by clicking dynamic linked menu icon
                        savantripathi Level 1

                        VectorP Ok sir i got your point. I am describing in short. CUrrently i have installed phonegap in my laptop. Now using command Phonegap create newproject.... I am creating a new project, in which there are different folders such as.. hooks,platforms,plugins,www and config.xml etc files are there.. Now as per documentation i am adding my files in www folder. I had replaced index.html with my new index.html. I have put all service files to my web server. and my database is in cloud. so here is my screenshot of www folder.. In which Index.html file is main file and inter-linked with different files using web services. so is it ok ? or i have forgotten some step to create application.?www_folder.png

                        • 9. Re: There is a network error by clicking dynamic linked menu icon
                          VectorP Level 4

                          Let's get back to a basic question first:

                          since you are posting this in the Phonegap Build forum....are you using Phonegap Build or do you build locally?


                          (If you are indeed using Phonegap Build, there's no point in creating a project with all kinds of directories that PGB doesn't want to be fed with, anyway).

                          • 10. Re: There is a network error by clicking dynamic linked menu icon
                            savantripathi Level 1

                            Yes I am using phonegap build. I mean i have develop demo app using the following reference.

                            GitHub - phonegap/phonegap-template-hello-world: PhoneGap Hello World app .

                            • 11. Re: There is a network error by clicking dynamic linked menu icon
                              VectorP Level 4

                              If you're using PGB, you are uploading the wrong things. PGB wants your assets and a config, only.

                              Do it this way:

                              1. Move config.xml into /www

                              2. Adjust the paths to icons/splashes in config

                              3. Zip up the CONTENTS of /www (not the directory itself) and upload that zip file

                              • 12. Re: There is a network error by clicking dynamic linked menu icon
                                savantripathi Level 1


                                Thank you sir. I am reading so many documentation thats why i am getting confused in small things. but now as per ur last suggestion i have manged to run my module successfully. and it is calling web service with database.


                                Thank you so much for ur precious time and help.