4 Replies Latest reply on Dec 12, 2016 2:29 PM by srkleiman

    Use of merges directory for icons and splash screens

    srkleiman Level 1

      I have a PGB app with substantial icon and splash screen assets. In order to cut down the size of the resulting app, I've been attempting to use the merges directory to ensure that only the android or IOS icons are installed in the appropriate package. So far this hasn't been working (the app works, but I get the default PG icons and splash screens). With the assets for both platforms installed in the "res" directory off the root, it works fine.

       

      What I have right now is the assets are installed in "merges/(android|ios)/res/(screen|icon)/". The config.xml entries refer to "www/res/(screen|icon)/...". The PBG logs look like the assets are moved to the correct locations in "www/res". Has anyone else been successful with this kind of strategy?

        • 1. Re: Use of merges directory for icons and splash screens
          kerrishotts Adobe Community Professional

          Use .pgbomit for this. See "Legacy Project" here App Project Structure | PhoneGap Docs

          • 2. Re: Use of merges directory for icons and splash screens
            srkleiman Level 1

            Thanks. After backing out the changes. I opened up the .apk and .ipa packages and realized that only the appropriate platform images are in each package. However, in the .apk there's only one splashscreen (res/drawable-mdpi-v4/splash.png) even though I provided ldpi, mdpi, hdpi, xhdpi, and xxhdpi in the required resolutions. The splash screen file is actually the ldpi image (which is also the default splash screen). Here's the relevant bits of config file:

             

                 <platform name="android">
                      <icon src="res/icon/android/ldpi.png"     density="ldpi" />
                      <icon src="res/icon/android/mdpi.png"     density="mdpi" />
                      <icon src="res/icon/android/hdpi.png"     density="hdpi" />
                      <icon src="res/icon/android/xhdpi.png"     density="xhdpi" />
                      <icon src="res/icon/android/xxhdpi.png"     density="xxhdpi" />
                      <splash src="res/screen/android/port-ldpi.png"          gap:density="port-ldpi" />
                      <splash src="res/screen/android/port-mdpi.png"          gap:density="port-mdpi" />
                      <splash src="res/screen/android/port-hdpi.png"          gap:density="port-hdpi" />
                      <splash src="res/screen/android/port-xhdpi.png"          gap:density="port-xhdpi" />
                      <splash src="res/screen/android/port-xxhdpi.png"     gap:density="port-xxhdpi" />
                      <splash src="res/screen/android/land-ldpi.png"          gap:density="land-ldpi" />
                      <splash src="res/screen/android/land-mdpi.png"          gap:density="land-mdpi" />
                      <splash src="res/screen/android/land-hdpi.png"          gap:density="land-hdpi" />
                      <splash src="res/screen/android/land-xhdpi.png"          gap:density="land-xhdpi" />
                      <splash src="res/screen/android/land-xxhdpi.png"     gap:density="land-xxhdpi" />
                 </platform>
                 <splash src="res/screen/android/port-ldpi.png"/>
                 <plugin name="cordova-plugin-splashscreen"     spec="4.0.0" />

            What am I doing wrong?

            • 3. Re: Use of merges directory for icons and splash screens
              VectorP Level 4

              You should use the 'qualifier' attribute for compound qualifiers, not the (gap:)density attribute.

              See the Icons and Splashes section of the PGB Docs

              • 4. Re: Use of merges directory for icons and splash screens
                srkleiman Level 1

                Thanks. That did it!

                 

                Apologies for not RTFM. In my defense it's hard to know when things that have been working are no longer applicable. It might help if PBG warned about obsolete syntax.