15 Replies Latest reply on Oct 7, 2016 1:38 PM by Chris W. Griffith

    Default Icon not getting replaced on device

    davids81255913

      I'm building my app via Phone Gap Build (cli-6.3.0), and I cannot seem to get my custom icon to replace the default icon (stock cordova icon) that appears on the device (android) once installed. My config.xml contains the following entry:

       

      <icon src="icon.png" />

       

      In my folder structure, the above noted icon.png is in my root directory, along with the config.xml and index.html.

       

      I have read through past discussions dealing with this topic, as well as the phone gap docs, and I cannot seem to determine the cause. Any resolved issues seemed to be related to issues that don't appear to apply to my case (incorrect folder structure, matching case between config value and directory name, etc.).

       

      I should add that the icon "does" appear on the build site...

       

       

      What do I need to do in order for my custom icon to appear on an android device after installation, rather than the default icon?

       

      Thanks in advance!

        • 1. Re: Default Icon not getting replaced on device
          kerrishotts Adobe Community Professional

          Please share your config.xml file in its entirety (minus identifying/secret information you don't want public) so we can take a look. Thx!

          • 2. Re: Default Icon not getting replaced on device
            davids81255913 Level 1

            Thanks very much for your response Kerri!! I'm really looking forward to getting this figured out!!

             

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

            <widget id="com.app.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

              <name>AppName</name>

              <description>

                App Description

              </description>

              <author email="" href="">

                App Author

              </author>

              <content src="index.html" />

             

             

              <!-- XHRS (SEE CSP)-->

               

              <!-- NAVIGATION -->

              <allow-navigation href="*" />

               

              <!-- INTENTS --> 

              <allow-intent href="*" /> 

             

             

              <icon src="icon.png" />

             

             

              <platform name="android">

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

                <preference name="SplashScreenDelay" value="10000" />

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

                <splash src="splash.png" />   

                <icon src="\images\favourite.png" />

                <icon src="\images\map.png" />

                <icon src="\images\marker.gif" />

                <icon src="\images\nav.png" />

                <icon src="\images\follow_user.png" />

                <icon src="\images\location.png" />

                <icon src="\images\change.png" />

                <icon src="\images\lock.png" />

                <icon src="\images\events.png" />

                <icon src="\images\statistics.png" />

                <icon src="\images\upload.png" />

                <icon src="\images\user.png" />

                <icon src="\images\settings.png" />

                <icon src="\images\comments.png" />

                <icon src="\images\clouds.png" />

                <icon src="\images\arrow-left.png" />

                <icon src="\images\arrow-right.png" />

                <icon src="\images\loginArrow.png" />

                <icon src="\images\mail.png" />

                <icon src="\images\mail-hover.png" />

                <icon src="\images\invites.png" />

                <icon src="\images\events-hover.png" />

                <icon src="\images\settings-hover.png" />

                <icon src="\images\statistics-hover.png" />

                <icon src="\images\pinellas.jpg" />

              </platform>

              <platform name="ios" />

              <platform name="windows" />

              <engine name="android" spec="~5.2.1" />

              <engine name="android" spec="~4.2.0" />

              <engine name="windows" spec="~4.4.1" /> 

              <plugin name="cordova-plugin-geolocation" spec="~2.2.0" />

              <plugin name="cordova-plugin-whitelist" spec="~1.2.2" />

              <plugin name="cordova-plugin-inappbrowser" spec="~1.4.0" />

              <plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/>

            </widget>

            • 3. Re: Default Icon not getting replaced on device
              VectorP Level 4

              You should use forward slashes in the paths. And the paths should not begin with a slash.

               

              Also: set the Android icons for a specific density/qualifier. I assume your icons are images for your app, not Android system icons.

              You must at least have the required iOS splashes and icons.

              You can't use the 'engine' elements

              • 4. Re: Default Icon not getting replaced on device
                davids81255913 Level 1

                Thanks very much for your help!

                 

                In other words, is the absence of the density/qualifier attribute and value in the below entry what is causing my issue?

                 

                <icon src="icon.png" />

                • 5. Re: Default Icon not getting replaced on device
                  davids81255913 Level 1

                  And yes, the images noted are for the app, not android system icons.

                  • 6. Re: Default Icon not getting replaced on device
                    VectorP Level 4

                    No, most likely not. It's all the other things (paths, slashes of the non-default icons).

                    • 7. Re: Default Icon not getting replaced on device
                      davids81255913 Level 1

                      So the below should do it (even minus the density/qualifier) ?

                       

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

                      <widget id="com.app.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

                        <name>AppName</name>

                        <description>

                          App Description

                        </description>

                        <author email="" href="">

                          App Author

                        </author>

                        <content src="index.html" />

                       

                       

                        <!-- XHRS (SEE CSP)-->

                         

                        <!-- NAVIGATION -->

                        <allow-navigation href="*" />

                         

                        <!-- INTENTS --> 

                        <allow-intent href="*" /> 

                       

                       

                        <icon src="icon.png" />

                       

                       

                        <platform name="android">

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

                          <preference name="SplashScreenDelay" value="10000" />

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

                          <splash src="splash.png" />   

                          <icon src="images/favourite.png" />

                          <icon src="images/map.png" />

                          <icon src="images/marker.gif" />

                          <icon src="images/nav.png" />

                          <icon src="images/follow_user.png" />

                          <icon src="images/location.png" />

                          <icon src="images/change.png" />

                          <icon src="images/lock.png" />

                          <icon src="images/events.png" />

                          <icon src="images/statistics.png" />

                          <icon src="images/upload.png" />

                          <icon src="images/user.png" />

                          <icon src="images/settings.png" />

                          <icon src="images/omments.png" />

                          <icon src="images/clouds.png" />

                          <icon src="images/arrow-left.png" />

                          <icon src="images/arrow-right.png" />

                          <icon src="images/loginArrow.png" />

                          <icon src="images/mail.png" />

                          <icon src="images/mail-hover.png" />

                          <icon src="images/invites.png" />

                          <icon src="images/events-hover.png" />

                          <icon src="images/settings-hover.png" />

                          <icon src="images/statistics-hover.png" />

                          <icon src="images/pinellas.jpg" />

                        </platform> 

                        <plugin name="cordova-plugin-geolocation" spec="~2.2.0" />

                        <plugin name="cordova-plugin-whitelist" spec="~1.2.2" />

                        <plugin name="cordova-plugin-inappbrowser" spec="~1.4.0" />

                        <plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/>

                      </widget>

                      • 8. Re: Default Icon not getting replaced on device
                        Chris W. Griffith Adobe Community Professional

                        If you want you can use ConfiGAP to assist in writing your config.xml file for PhoneGap Build. It is free from configap.com

                         

                        Chris

                        • 9. Re: Default Icon not getting replaced on device
                          VectorP Level 4

                          What are all these icons in the 'android' part? You seem to believe that you must declare all icons/images you are using in your app. However, you are supposed to specify the app icons for the various densities, only. Those are the icons that appear on the home screen of the Android OS.

                          1 person found this helpful
                          • 10. Re: Default Icon not getting replaced on device
                            davids81255913 Level 1

                            Yes, thank you! I was under the impression all images and/or icons had to be declared.That solved my issue!

                             

                            Thanks Vector!

                            • 11. Re: Default Icon not getting replaced on device
                              mlkepleyassociates

                              Vector,

                              You seem to really know your stuff! Think you could give me a hand? I'm not very versed in coding and am trying to help out a client.

                              Here is my code, and my files. I cannot get the icon to show up on Andriod device; it still shows default icon.

                              Here is my config.:

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

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

                                 

                                  <name></name>

                                  <description></description>

                                  <author email="" href="">TTT Webmaster</author>

                               

                               

                                  <preference name="phonegap-version" value="3.3.0" />

                                  <feature name="http://api.phonegap.com/1.0/device" />

                                 

                                  <preference name="orientation"                value="portrait" />       <!-- all: default means both landscape and portrait are enabled -->

                                 

                                  <gap:plugin name="org.apache.cordova.device" />

                                  <gap:plugin name="org.apache.cordova.camera" />

                                  <gap:plugin name="org.apache.cordova.media-capture" />

                                  <gap:plugin name="org.apache.cordova.file" />

                                  <gap:plugin name="org.apache.cordova.file-transfer" />

                                  <gap:plugin name="org.apache.cordova.splashscreen" />

                                  <gap:plugin name="org.apache.cordova.contacts" />

                                  <gap:plugin name="org.apache.cordova.geolocation" />

                                  <gap:plugin name="org.apache.cordova.inappbrowser" />

                                  <gap:plugin name="org.apache.cordova.dialogs" />

                                  <gap:plugin name="org.apache.cordova.vibration" />

                                  <gap:plugin name="org.apache.cordova.network-information" />

                                  <gap:plugin name="com.simplec.plugins.localnotification" />

                               

                               

                                <icon src="icon.png" />

                               

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

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

                                  <icon src="res/icons/ios/icon-72.png" gap:platform="ios" width="76" height="76" />

                                  <icon src="res/icons/ios/icon-72@2x.png" gap:platform="ios" width="152" height="152" />

                               

                               

                                  <icon src="res/icons/android/drawable-ldpi/icon.png" gap:platform="android" gap:density="ldpi" />

                                  <icon src="res/icons/android/drawable-mdpi/icon.png" gap:platform="android" gap:density="mdpi" />

                                  <icon src="res/icons/android/drawable-hdpi/icon.png" gap:platform="android" gap:density="hdpi" />

                                  <icon src="res/icons/android/drawable-xdpi/icon.png" gap:platform="android" gap:density="xhdpi" />

                               

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

                                 

                                  <gap:splash src="res/screen/android/drawable-ldpi/splash.png"  gap:platform="android" gap:density="ldpi" />

                                  <gap:splash src="res/screen/android/drawable-mdpi/splash.png"  gap:platform="android" gap:density="mdpi" />

                                  <gap:splash src="res/screen/android/drawable-hdpi/splash.png"  gap:platform="android" gap:density="hdpi" />

                                  <gap:splash src="res/screen/android/drawable-xdpi/splash.png" gap:platform="android" gap:density="xhdpi" />

                                 

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

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

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

                               

                               

                                  <content src="http://www.tritasktakers.com/schedule" />

                                  <access origin="*" subdomains="true" />

                              </widget>

                               

                               

                              Capture.PNG

                              • 12. Re: Default Icon not getting replaced on device
                                VectorP Level 4

                                1. About your config:

                                a) You can't use feature elements. Please remove.

                                b) You should not use the ancient plugins from the deprecated pgb repo. Use the latest versions of the plugins from npm, instead. Be aware that they are named differently.

                                c) Use the newer syntax without the gap: namespace. See the PGB Docs, Configuring section.

                                d) It's not worth bothering with Phonegap-version 3.3.0: many plugins won't work with this version, and Google will not accept the generated apk-file, anyway. You must at least use PGB cli-5.x, but I would recommend going to cli-6.3.0 right away.

                                Be ware that you need to add whitelisting, then, including the cordova-plugin-whitelist. Read its docs!

                                 

                                2. About your file structure:

                                I can't see where your index.html and config.xml are located within your PGB zip file. This is relevant, though!

                                Do you have both index.html and config.xml in the root directory of the zip, and is your /res directory a direct child of the root?

                                • 13. Re: Default Icon not getting replaced on device
                                  mlkepleyassociates Level 1

                                  I seem to have made it worse. Would you be willing to correct this for me and I will pay you? I have seriously spent over 20 hours the last 2 weeks trying to get this right with no luck. If you were willing, please let me know how much. Thank you so much!

                                   

                                  <?xml version='cli-6.3.0' encoding='utf-8'?>

                                  <widget id="com.tritasktakers.www" version="cli-6.3.0" xmlns="http://www.w3.org/ns/widgets"

                                  xmlns:cdv="http://cordova.apache.org/ns/cli-6.3.0">

                                     

                                      <name>TriTaskTakers</name>

                                      <description>Taking Tasks All Over The Triangle</description>

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

                                   

                                   

                                  <content src="http://tritasktakers.com/schedule"></content>

                                   

                                   

                                  <access origin="*" />

                                   

                                   

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

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

                                  <allow-intent href="*" />

                                   

                                   

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

                                     

                                      <preference name="orientation"                value="portrait" />       <!-- all: default means both landscape and portrait are enabled -->

                                   

                                   

                                  <plugin name="org.apache.cordova.device" />

                                      <plugin name="org.apache.cordova.camera" />

                                      <plugin name="org.apache.cordova.media-capture" />

                                      <plugin name="org.apache.cordova.file" />

                                      <plugin name="org.apache.cordova.file-transfer" />

                                      <plugin name="org.apache.cordova.splashscreen" />

                                      <plugin name="org.apache.cordova.contacts" />

                                      <plugin name="org.apache.cordova.geolocation" />

                                      <plugin name="org.apache.cordova.inappbrowser" />

                                      <plugin name="org.apache.cordova.dialogs" />

                                      <plugin name="org.apache.cordova.vibration" />

                                      <plugin name="org.apache.cordova.network-information" />

                                      <plugin name="com.simplec.plugins.localnotification" />

                                   

                                   

                                      

                                    <icon src="icon.png" />

                                   

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

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

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

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

                                   

                                   

                                      <icon src="res/icons/android/drawable-ldpi/icon.png" platform="android" gap:density="ldpi" />

                                      <icon src="res/icons/android/drawable-mdpi/icon.png" platform="android" gap:density="mdpi" />

                                      <icon src="res/icons/android/drawable-hdpi/icon.png" platform="android" gap:density="hdpi" />

                                      <icon src="res/icons/android/drawable-xdpi/icon.png" platform="android" gap:density="xhdpi" />

                                   

                                      <splash src="splash.png" />

                                     

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

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

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

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

                                     

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

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

                                      <splash src="res/screen/ios/Deafult-568h-2x.png" platform="ios" width="640" height="1136" />

                                   

                                   

                                     </widget>

                                  • 14. Re: Default Icon not getting replaced on device
                                    VectorP Level 4

                                    You don't pay for help at this forum.

                                     

                                    There's not much wrong with your config.

                                    However:

                                    1. You are using old, deprecated plugins from the pgb repo. Use the latest plugins from npm, instead.

                                    For instance:

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

                                     

                                    2. You don't need namespace

                                    xmlns:cdv

                                     

                                    3. This is wrong:

                                    version="cli-6.3.0"

                                    Instead, use

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

                                    (Which you already have)

                                     

                                    4. About this:

                                    <content src="http://tritasktakers.com/schedule"></content>

                                    Are you really just wrapping a website?

                                    If so, are you aware that most likely both Apple and Google will reject the app?

                                     

                                    5. Do you really need all those plugins?

                                    Remove what you don't need.

                                     

                                    6. However, since you have whitelisting rules, you will need:

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

                                    Make sure you read and apply its documentation!

                                     

                                    7. For Android, you only have icons and splashes up to xhdpi. I would suggest you include the larger ones, too.

                                    For iOS, you are missing a whole bunch of icons and splashes. See the Apple UI guidelines

                                    • 15. Re: Default Icon not getting replaced on device
                                      Chris W. Griffith Adobe Community Professional

                                      To add to VectorP

                                       

                                      <?xml version='cli-6.3.0' encoding='utf-8'?>

                                      should be

                                      <?xml version="1.0" encoding="UTF-8" ?>

                                       

                                      I would read over Configuring | PhoneGap Docs to understand the elements.

                                       

                                      Also, the <content> tag should not be used in PhoneGap Build. VectorP's comment on just wrapping a website is 100% valid.

                                       

                                      Chris