Phonegap build and Splashscreen


#1

Hi
I wasn’t able to rebuilt with phonegap an old project of mine.
After 2 days of troubles, finally i have been able to build it again and i want to share the solution with people who might face the same issue.
What i did first was to find out on the page of Adobe PhoneGap Build
https://build.phonegap.com/apps/xxxxxxx/builds
(xxxxxxx my BuildID in Appstudio)
by the Log Error you find on that page, what was the reason of the failure of posting the project by the IDE Appstudio.
I understood that it was just a matter of Phonegap version and plugins version (spec) used.
Because, when there is any modification on phonegap or any plugin, your projects could be badly affected, i strongly suggest to specify the version actually working for your project; you can get a list from the Log or by clicking on the button Plugins of that page to go to the list
https://build.phonegap.com/apps/xxxxxxx/plugins
of your plugins with their version number.
The config.xml file that worked for me is the following one.

<?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.nsbasic.{id}"
version = "{version}">

<name>{title}</name>
<description>{description}</description>

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

	<preference name="permissions" value="none"/> 
	<preference name="orientation" value="portrait"/>
	<preference name="target-device" value="universal"/>
	<preference name="fullscreen" value="false"/>
	<preference name="prerendered-icon" value="true"/>
	<preference name="EnableViewportScale" value="true"/>
	<preference name="DisallowOverscroll" value="true" />


<plugin name="cordova-plugin-camera"                    spec="2.1.1" />
<plugin name="cordova-plugin-device"                    spec="2.0.2" />
<plugin name="cordova-plugin-splashscreen"              spec="5.0.2" />
<plugin name="cordova-plugin-vibration"                 spec="3.1.0" />
<plugin name="phonegap-plugin-barcodescanner"           spec="5.0.1" />
<plugin name="cordova-plugin-bluetooth-serial"          spec="0.4.7" />
<plugin name="cordova-plugin-insomnia"                  spec="4.3.0" />
<plugin name="cordova-plugin-flashlight"                spec="3.2.0" />

<feature name="http://api.phonegap.com/1.0/camera"/>
<feature name="http://api.phonegap.com/1.0/device"/>
<feature name="http://api.phonegap.com/1.0/vibration"/>
<feature name="https://github.com/VersoSolutions/CordovaClipboard"/>


<platform name="android">
	<icon qualifier="ldpi" src="res/icons/android/drawable-ldpi-icon.png" />
	<icon qualifier="mdpi" src="res/icons/android/drawable-mdpi-icon.png" />
	<icon qualifier="hdpi" src="res/icons/android/drawable-hdpi-icon.png" />
	<icon qualifier="xhdpi" src="res/icons/android/drawable-xhdpi-icon.png" />
	<icon qualifier="xxhdpi" src="res/icons/android/drawable-xxhdpi-icon.png" />
	<icon qualifier="xxxhdpi" src="res/icons/android/drawable-xxxhdpi-icon.png" />
	<splash qualifier="land-ldpi" src="res/screens/android/drawable-land-ldpi-screen.png" />
	<splash qualifier="land-mdpi" src="res/screens/android/drawable-land-mdpi-screen.png" />
	<splash qualifier="land-hdpi" src="res/screens/android/drawable-land-hdpi-screen.png" />
	<splash qualifier="land-xhdpi" src="res/screens/android/drawable-land-xhdpi-screen.png" />
	<splash qualifier="land-xxhdpi" src="res/screens/android/drawable-land-xxhdpi-screen.png" />
	<splash qualifier="land-xxxhdpi" src="res/screens/android/drawable-land-xxxhdpi-screen.png" />

</platform>

<splash src="{splashscreen}"/>
<preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashScreenDelay" value="8000" /> 

</widget>

Remember that the list of icons and splashscreen images must be entered also in your manifest with \ instead of / for example
res\icons\android\drawable-ldpi-icon.png
res\icons\android\drawable-mdpi-icon.png
res\icons\android\drawable-hdpi-icon.png
res\icons\android\drawable-xhdpi-icon.png
res\icons\android\drawable-xxhdpi-icon.png
res\icons\android\drawable-xxxhdpi-icon.png
res\screens\android\drawable-land-ldpi-screen.png
res\screens\android\drawable-land-mdpi-screen.png
res\screens\android\drawable-land-hdpi-screen.png
res\screens\android\drawable-land-xhdpi-screen.png
res\screens\android\drawable-land-xxhdpi-screen.png
res\screens\android\drawable-land-xxxhdpi-screen.png

If the version of Phonegap or plugins is left blank in your project, or in the case your plugins version doesn’t match with the proper phonegap version, your app may not work in a future rebuilding.
Hope this will help some one.
:slight_smile:


#2

The format of this seems to evolve with each new release of PhoneGap Build. We’re using cli-8.0.0 as the version now for all our builds.

To generate all the icon and splashscreen variations, we have been using https://www.resource-generator.com/


#3

Hi, I’ve struggled with this for over a week now. I managed to get the splashscreens working as per your config file but I found the build quality for the icons were not very good. They were even worse if there was any transparency in the icon. I ended up using this: (Only folder I had to put in the manifest was res) The app past through cli-8.0.0 wthout any probs.

<!-- Icons -->
    <icon src="icon.png" />
    <icon src="res/icon/android/icon-36-ldpi.png"   gap:platform="android"    gap:qualifier="ldpi" />
    <icon src="res/icon/android/icon-48-mdpi.png"   gap:platform="android"    gap:qualifier="mdpi" />
    <icon src="res/icon/android/icon-72-hdpi.png"   gap:platform="android"    gap:qualifier="hdpi" />
    <icon src="res/icon/android/icon-96-xhdpi.png"  gap:platform="android"    gap:qualifier="xhdpi" />
    <icon src="res/icon/android/icon-114-xxhdpi.png"  gap:platform="android"    gap:qualifier="xxhdpi" />
    <icon src="res/icon/android/icon-192-xxxhdpi.png"  gap:platform="android"    gap:qualifier="xxxhdpi" />

<!-- Splash Screens -->
<preference name='SplashScreenDelay' value='2000' />
<preference name='AutoHideSplashScreen' value='true' />
<gap:splash src='{splashscreen}'/>
<gap:plugin name='cordova-plugin-splashscreen' source='npm' />

<platform name="android">
	<splash qualifier="land-ldpi" src="res/screens/android/drawable-land-ldpi-screen.png" />
	<splash qualifier="land-mdpi" src="res/screens/android/drawable-land-mdpi-screen.png" />
	<splash qualifier="land-hdpi" src="res/screens/android/drawable-land-hdpi-screen.png" />
	<splash qualifier="land-xhdpi" src="res/screens/android/drawable-land-xhdpi-screen.png" />
	<splash qualifier="land-xxhdpi" src="res/screens/android/drawable-land-xxhdpi-screen.png" />
	<splash qualifier="land-xxxhdpi" src="res/screens/android/drawable-land-xxxhdpi-screen.png" />
	<splash qualifier="port-ldpi" src="res/screens/android/drawable-port-ldpi-screen.png" />
	<splash qualifier="port-mdpi" src="res/screens/android/drawable-port-mdpi-screen.png" />
	<splash qualifier="port-hdpi" src="res/screens/android/drawable-port-hdpi-screen.png" />
	<splash qualifier="port-xhdpi" src="res/screens/android/drawable-port-xhdpi-screen.png" />
	<splash qualifier="port-xxhdpi" src="res/screens/android/drawable-port-xxhdpi-screen.png" />
	<splash qualifier="port-xxxhdpi" src="res/screens/android/drawable-port-xxxhdpi-screen.png" />
</platform>


<preference name="permissions" value="none"/>
<!-- sample preference specifications -->
<!-- <preference name="autorotate" value="false" readonly="true"/> -->
<!-- <preference name="orientation" value="default" /> -->
<!-- <preference name="fullscreen" value="true" /> -->

<!-- Platforms: Customize as needed. -->
<gap:platforms>
   <gap:platform name="android" />
</gap:platforms>

<plugin name="cordova-plugin-statusbar" source="npm" />
  <preference name="StatusBarOverlaysWebView" value="{phoneGapStatusBarOverlay}" />
  <preference name="StatusBarBackgroundColor" value="{phoneGapStatusBarColor}" />
  <preference name="StatusBarStyle" value="{phoneGapStatusBarStyle}" />

<plugin name="cordova-plugin-whitelist" source="npm" />
  <allow-navigation href="*" />
  <access origin="*" />
</widget>

#4

right, also for me 8.0.0 is working now.
so it was just a matter of definition of the proper plugins version and icon/splashscreen needed.


#5

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.