Building for Android 12 - Splashscreen

I have just modified my app’s config.xml to try and conform with the upcoming Google PlayStore requirement to support Android 12 as detailed on the VoltBuilder website.

I have been reading Building for Android 12 and did several things to my app, which had worked perfectly well beforehand.

I included the engine element as per the recommendations.

I removed all my icon and splash screen entries and put in the elements for VoltBuilder to do it, again as per recommendations.

I took out the whitelist plugin.

I put in the required files in the top level resource folder of the zip file as follows.

iconTemplate.png

splashTemplate.png

resources.json

This is the contents of resources.json.

{
    "fit": "contain",
    "icon-background-source": "#062342",
    "orientation": "portrait",
    "position": "center"
}

I then deleted from the resources folder all the various png files that used to be included for specific splashscreen and icon sizes.

Submitting the rebuilt zip to VoltBuilder results in a successful release app, but when I try and side load the downloaded apk onto a physical device, I get the message “App not installed as package appears to be invalid”.

I checked the log file, but cannot see any errors except for those referring to adaptive icons. I haven’t made any provision for adaptive icons. There are no files in the zip for it and no config.xml elements that relate to adaptive icons, so this is all very confusing.

I would be very grateful if you could have a look at the extract from the build log that contains the error messages, below, and point out where I might have gone wrong.

2022-10-12 12:23:34,794 - Output: 2022-10-12T12:23:33.525Z cordova-res Paths: (config: '/config.xml') (resources dir: 'resources')
2022-10-12T12:23:33.533Z cordova-res:platform Running android platform with options: {
  'adaptive-icon': {
    icon: { sources: [Array] },
    foreground: { sources: [Array] },
    background: { sources: [Array] }
  },
  icon: {
    sources: [
      '/resources/iconTemplate.png'
    ]
  },
  splash: {
    sources: [
      '/resources/splashTemplate.png'
    ]
  }
}
2022-10-12T12:23:33.533Z cordova-res:platform Building adaptive-icon resources
2022-10-12T12:23:33.533Z cordova-res:platform Building icon resources for android platform
2022-10-12T12:23:33.542Z cordova-res:image Source image for icon: {
  format: 'png',
  size: 75122,
  width: 1024,
  height: 1024,
  space: 'srgb',
  channels: 4,
  depth: 'uchar',
  density: 96,
  isProgressive: false,
  hasProfile: false,
  hasAlpha: true
}
2022-10-12T12:23:33.542Z cordova-res:platform Using '/resources/iconTemplate.png' for icon source image for android
2022-10-12T12:23:33.544Z cordova-res:image Generating 'resources/android/icon/drawable-ldpi-icon.png' (36x36) fit='contain' position='center'
2022-10-12T12:23:33.545Z cordova-res:image Generating 'resources/android/icon/drawable-xxxhdpi-icon.png' (192x192) fit='contain' position='center'
2022-10-12T12:23:33.546Z cordova-res:image Generating 'resources/android/icon/drawable-xxhdpi-icon.png' (144x144) fit='contain' position='center'
2022-10-12T12:23:33.546Z cordova-res:image Generating 'resources/android/icon/drawable-mdpi-icon.png' (48x48) fit='contain' position='center'
2022-10-12T12:23:33.547Z cordova-res:image Generating 'resources/android/icon/drawable-xhdpi-icon.png' (96x96) fit='contain' position='center'
2022-10-12T12:23:33.585Z cordova-res:image Generating 'resources/android/icon/drawable-hdpi-icon.png' (72x72) fit='contain' position='center'
2022-10-12T12:23:33.607Z cordova-res:image Source file missing: resources/android/icon-foreground.png
2022-10-12T12:23:33.607Z cordova-res:image Source file missing: resources/android/icon-foreground.jpg
2022-10-12T12:23:33.607Z cordova-res:image Source file missing: resources/android/icon-foreground.jpeg
2022-10-12T12:23:33.608Z cordova-res:platform Error with adaptive icons: Error
    at new BaseError (/usr/lib/node_modules/cordova-res/dist/error.js:8:22)
    at new ResolveSourceImageError (/usr/lib/node_modules/cordova-res/dist/error.js:45:9)
    at Object.resolveSourceImage (/usr/lib/node_modules/cordova-res/dist/image.js:31:11)
    at async generateAdaptiveIconResourcesPortion (/usr/lib/node_modules/cordova-res/dist/platform.js:190:20)
    at async generateAdaptiveIconResources (/usr/lib/node_modules/cordova-res/dist/platform.js:148:74)
    at async safelyGenerateAdaptiveIconResources (/usr/lib/node_modules/cordova-res/dist/platform.js:128:16)
    at async Object.run (/usr/lib/node_modules/cordova-res/dist/platform.js:24:28)
    at async AsyncFunction.CordovaRes [as run] (/usr/lib/node_modules/cordova-res/dist/index.js:35:36)
    at async AsyncFunction.runCommandLine (/usr/lib/node_modules/cordova-res/dist/index.js:93:28) {
  errors: [],
  code: 'BAD_SOURCES'
}
2022-10-12T12:23:33.608Z cordova-res:platform Building icon resources for android platform
2022-10-12T12:23:33.609Z cordova-res:image Source image for icon: {
  format: 'png',
  size: 75122,
  width: 1024,
  height: 1024,
  space: 'srgb',
  channels: 4,
  depth: 'uchar',
  density: 96,
  isProgressive: false,
  hasProfile: false,
  hasAlpha: true
}
2022-10-12T12:23:33.609Z cordova-res:platform Using '/resources/iconTemplate.png' for icon source image for android
2022-10-12T12:23:33.609Z cordova-res:image Generating 'resources/android/icon/drawable-ldpi-icon.png' (36x36) fit='contain' position='center'
2022-10-12T12:23:33.610Z cordova-res:image Generating 'resources/android/icon/drawable-hdpi-icon.png' (72x72) fit='contain' position='center'
2022-10-12T12:23:33.610Z cordova-res:image Generating 'resources/android/icon/drawable-xhdpi-icon.png' (96x96) fit='contain' position='center'
2022-10-12T12:23:33.611Z cordova-res:image Generating 'resources/android/icon/drawable-xxxhdpi-icon.png' (192x192) fit='contain' position='center'
2022-10-12T12:23:33.611Z cordova-res:image Generating 'resources/android/icon/drawable-xxhdpi-icon.png' (144x144) fit='contain' position='center'
2022-10-12T12:23:33.611Z cordova-res:image Generating 'resources/android/icon/drawable-mdpi-icon.png' (48x48) fit='contain' position='center'
2022-10-12T12:23:33.667Z cordova-res:platform Building splash resources for android platform
2022-10-12T12:23:33.668Z cordova-res:image Source image for splash: {
  format: 'png',
  size: 241630,
  width: 2732,
  height: 2732,
  space: 'srgb',
  channels: 4,
  depth: 'uchar',
  density: 96,
  isProgressive: false,
  hasProfile: false,
  hasAlpha: true
}
2022-10-12T12:23:33.668Z cordova-res:platform Using '/resources/splashTemplate.png' for splash source image for android
2022-10-12T12:23:33.669Z cordova-res:image Generating 'resources/android/splash/drawable-land-ldpi-screen.png' (320x240) fit='contain' position='center'
2022-10-12T12:23:33.671Z cordova-res:image Generating 'resources/android/splash/drawable-land-mdpi-screen.png' (480x320) fit='contain' position='center'
2022-10-12T12:23:33.672Z cordova-res:image Generating 'resources/android/splash/drawable-land-xhdpi-screen.png' (1280x720) fit='contain' position='center'
2022-10-12T12:23:33.672Z cordova-res:image Generating 'resources/android/splash/drawable-land-hdpi-screen.png' (800x480) fit='contain' position='center'
2022-10-12T12:23:33.672Z cordova-res:image Generating 'resources/android/splash/drawable-land-xxhdpi-screen.png' (1600x960) fit='contain' position='center'
2022-10-12T12:23:33.673Z cordova-res:image Generating 'resources/android/splash/drawable-land-xxxhdpi-screen.png' (1920x1280) fit='contain' position='center'
2022-10-12T12:23:33.673Z cordova-res:image Generating 'resources/android/splash/drawable-port-ldpi-screen.png' (240x320) fit='contain' position='center'
2022-10-12T12:23:33.673Z cordova-res:image Generating 'resources/android/splash/drawable-port-mdpi-screen.png' (320x480) fit='contain' position='center'
2022-10-12T12:23:33.674Z cordova-res:image Generating 'resources/android/splash/drawable-port-hdpi-screen.png' (480x800) fit='contain' position='center'
2022-10-12T12:23:33.674Z cordova-res:image Generating 'resources/android/splash/drawable-port-xhdpi-screen.png' (720x1280) fit='contain' position='center'
2022-10-12T12:23:33.675Z cordova-res:image Generating 'resources/android/splash/drawable-port-xxhdpi-screen.png' (960x1600) fit='contain' position='center'
2022-10-12T12:23:33.676Z cordova-res:image Generating 'resources/android/splash/drawable-port-xxxhdpi-screen.png' (1280x1920) fit='contain' position='center'
Generated 18 resources for Android
2022-10-12T12:23:34.768Z cordova-res:cordova:config Orientation preference: undefined
2022-10-12T12:23:34.769Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='ldpi']" ])
2022-10-12T12:23:34.769Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='mdpi']" ])
2022-10-12T12:23:34.770Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='hdpi']" ])
2022-10-12T12:23:34.770Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xhdpi']" ])
2022-10-12T12:23:34.770Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xxhdpi']" ])
2022-10-12T12:23:34.770Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xxxhdpi']" ])
2022-10-12T12:23:34.770Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-ldpi']" ])
2022-10-12T12:23:34.770Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-mdpi']" ])
2022-10-12T12:23:34.770Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-hdpi']" ])
2022-10-12T12:23:34.771Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xhdpi']" ])
2022-10-12T12:23:34.771Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xxhdpi']" ])
2022-10-12T12:23:34.771Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xxxhdpi']" ])
2022-10-12T12:23:34.771Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-ldpi']" ])
2022-10-12T12:23:34.771Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-mdpi']" ])
2022-10-12T12:23:34.771Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-hdpi']" ])
2022-10-12T12:23:34.771Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xhdpi']" ])
2022-10-12T12:23:34.771Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xxhdpi']" ])
2022-10-12T12:23:34.771Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xxxhdpi']" ])
Wrote to config.xml

Following on from my original post, I have a question on directory structure. My app folder structure used to have its resource images in a top level directory called “res”. However the instructions on building for Android 12 reference additional instructions for Generating Icons and Splash Screens, and there the resources folder is now called “resources” rather than “res”.

I assumed from this that I should rename my existing “res” folder as “resources”, and this is what I did. Was that correct, or should there now be two separate top level folders called “res” and “resources”?

If you’re having VoltBuilder create your splashscreens and icons automatically, the resources folder has to be called resources.

The adaptive icon message probably isn’t what is stopping your app from installing. Do you have a older version of your app on your device? If so, try deleting that.

Thank you for the clarification on the resources folder name to be used when VoltBuilder creates splashscreens and icons, and I did have an older version of the app on the device, which I uninstalled, and the new build installed. However, it does not work correctly at all.

  1. The screen clears completely to the color specified in the AndroidWindowSplashScreenBackground preference, but no splash image appears, it’s just a plain, solid color.

  2. Network communications have disappeared completely. The app initially calls a plain http web service in order to acquire some operating parameters (an IP address and port number) so that it can connect to a local websocket server, but since making the mods to build for Android 12 it looks like this is now being blocked, so the app is totally useless.

OK, so you’re making progress.

  1. Look closely at your splash files, etc. It sounds like there is a problem there.

  2. Sounds like you may be having CORS issues. Connect a Remote Debugger and look for errors.

  1. I have looked very closely at the splash files and there is no problem. An icon is generated and the apk shows up with the required icon, but the splash screen logo is completely missing. The splash screen appears as just a solid block of color (it is the correct color, as specified in AndroidWindowSplashScreenBackground), but there is nothing showing from the splashTemplate.png that is correctly located in the resources folder and it has a resolution of 2732x2732 as per the instructions. One thing I am not sure of is whether there is a required image pixel density. I notice that in another support thread on missing splash screens that image density is mentioned as a potential error source. Both the icon and splash template png files are 96dpi. Is this acceptable?

  2. I have a resources.json file in the resources folder with the following content.
    {
    “fit”: “fill”,
    “icon-background-source”: “#062342”,
    “orientation”: “portrait”,
    “position”: “center”
    }

  3. The lack of network communications was fixed by putting in this config.xml entry:
    <preference name="AndroidInsecureFileModeEnabled" value="true" />
    Yep, I know, you would never guess from its name or its description on the Cordova website that it has anything to do with enabling mixed mode connectivity, but it sure has. I recommend you mention it in VoltBuilder’s “Building for Android 12” page. Actually, I think it was introduced as part of the Cordova 10.0.0 development, but if people are jumping from 9.0.0 to 11.0.0 like I am doing, it may be important to know about.

  1. Here’s a splash screen which I know works. Can you try it with your project and see what happens?

  2. Your resources.json file looks reasonable - what happens if you leave it out?

  3. Were there any error messages at runtime? That would help better describe who might need this. (And thanks for giving this tip!)

  1. The known-good splashTemplate.jpg you kindly provided does not appear. It is the same as before, the screen clears to the selected background color, but there’s no splash image.

  2. Removing the resources.json file makes no difference, either.

  3. If I look in the res folder of the apk downloaded from VoltBuilder, there are no images derived from the known-good template. What’s there is a series of name-obfuscated png files in various sizes, all with the default Cordova logo.

  4. Checking out the VoltBuilder.log reveals this entry:
    The "AndroidWindowSplashScreenAnimatedIcon" had an unsupported extension. Cordova's default will be used.
    And this is the corresponding entry from config.xml, which looks alright to me:
    <preference name="AndroidWindowSplashScreenAnimatedIcon" value="resources/splashTemplate.jpg" />

  5. Looking at the Cordova Splashscreen documentation, it says this: AndroidWindowSplashScreenAnimatedIcon
    The splash screen image. This preference is used for both animated and non-animated icons. The current acceptable asset files can either be an XML Vector Drwable or PNG.

Thank you. I will be seeing if I can duplicate your results here.

I have been looking at the log from my latest build attempt, which now uses splashTemplate.png instead of jpg. This is the section of note:

2022-10-18T12:06:45.278Z cordova-res:platform Using '/resources/iconTemplate.png' for icon source image for android
2022-10-18T12:06:45.279Z cordova-res:image Generating 'resources/android/icon/drawable-ldpi-icon.png' (36x36) fit='contain' position='center'
2022-10-18T12:06:45.279Z cordova-res:image Generating 'resources/android/icon/drawable-xhdpi-icon.png' (96x96) fit='contain' position='center'
2022-10-18T12:06:45.280Z cordova-res:image Generating 'resources/android/icon/drawable-hdpi-icon.png' (72x72) fit='contain' position='center'
2022-10-18T12:06:45.281Z cordova-res:image Generating 'resources/android/icon/drawable-xxhdpi-icon.png' (144x144) fit='contain' position='center'
2022-10-18T12:06:45.282Z cordova-res:image Generating 'resources/android/icon/drawable-xxxhdpi-icon.png' (192x192) fit='contain' position='center'
2022-10-18T12:06:45.282Z cordova-res:image Generating 'resources/android/icon/drawable-mdpi-icon.png' (48x48) fit='contain' position='center'
2022-10-18T12:06:45.363Z cordova-res:platform Building splash resources for android platform
2022-10-18T12:06:45.364Z cordova-res:image Source image for splash: {
  format: 'png',
  size: 241630,
  width: 2732,
  height: 2732,
  space: 'srgb',
  channels: 4,
  depth: 'uchar',
  density: 96,
  isProgressive: false,
  hasProfile: false,
  hasAlpha: true
}
2022-10-18T12:06:45.364Z cordova-res:platform Using '/resources/splashTemplate.png' for splash source image for android
2022-10-18T12:06:45.365Z cordova-res:image Generating 'resources/android/splash/drawable-land-ldpi-screen.png' (320x240) fit='contain' position='center'
2022-10-18T12:06:45.366Z cordova-res:image Generating 'resources/android/splash/drawable-land-hdpi-screen.png' (800x480) fit='contain' position='center'
2022-10-18T12:06:45.366Z cordova-res:image Generating 'resources/android/splash/drawable-land-xxhdpi-screen.png' (1600x960) fit='contain' position='center'
2022-10-18T12:06:45.367Z cordova-res:image Generating 'resources/android/splash/drawable-land-xxxhdpi-screen.png' (1920x1280) fit='contain' position='center'
2022-10-18T12:06:45.367Z cordova-res:image Generating 'resources/android/splash/drawable-land-mdpi-screen.png' (480x320) fit='contain' position='center'
2022-10-18T12:06:45.368Z cordova-res:image Generating 'resources/android/splash/drawable-port-ldpi-screen.png' (240x320) fit='contain' position='center'
2022-10-18T12:06:45.368Z cordova-res:image Generating 'resources/android/splash/drawable-land-xhdpi-screen.png' (1280x720) fit='contain' position='center'
2022-10-18T12:06:45.369Z cordova-res:image Generating 'resources/android/splash/drawable-port-mdpi-screen.png' (320x480) fit='contain' position='center'
2022-10-18T12:06:45.370Z cordova-res:image Generating 'resources/android/splash/drawable-port-hdpi-screen.png' (480x800) fit='contain' position='center'
2022-10-18T12:06:45.370Z cordova-res:image Generating 'resources/android/splash/drawable-port-xhdpi-screen.png' (720x1280) fit='contain' position='center'
2022-10-18T12:06:45.371Z cordova-res:image Generating 'resources/android/splash/drawable-port-xxhdpi-screen.png' (960x1600) fit='contain' position='center'
2022-10-18T12:06:45.371Z cordova-res:image Generating 'resources/android/splash/drawable-port-xxxhdpi-screen.png' (1280x1920) fit='contain' position='center'
Generated 18 resources for Android
2022-10-18T12:06:46.487Z cordova-res:cordova:config Orientation preference: undefined
2022-10-18T12:06:46.488Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='ldpi']" ])
2022-10-18T12:06:46.488Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='mdpi']" ])
2022-10-18T12:06:46.488Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='hdpi']" ])
2022-10-18T12:06:46.488Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xhdpi']" ])
2022-10-18T12:06:46.488Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xxhdpi']" ])
2022-10-18T12:06:46.488Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xxxhdpi']" ])
2022-10-18T12:06:46.488Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-ldpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-mdpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-hdpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xhdpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xxhdpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xxxhdpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-ldpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-mdpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-hdpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xhdpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xxhdpi']" ])
2022-10-18T12:06:46.489Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xxxhdpi']" ])
Wrote to config.xml

2022-10-18 12:07:28,173 - Output: The "<splash>" tags were detected and are no longer supported. Please migrate to the "preference" tag "AndroidWindowSplashScreenAnimatedIcon".

The final line looks interesting! I made very sure to not include any splash… tags in my config.xml, even removing commented out blocks that were there before. Yet the log refers to unsupported splash tags. I assume from this that the VoltBuilder build process is generating them. However, when referring to Cordova’s documentation it states that this is not required any longer, even for backward compatibility with pre Android 12 systems, because the latest Cordova engine creates them itself. It seems to me, as a hapless bystander, that perhaps VoltBuilder and the latest Cordova engine might be working at cross purposes somehow?

I sent you a test app yesterday. Let me know what it does on your device.

How did you send it? I have received nothing via email or messages on this forum.

I’ll send you a DM…

Hello,

I’m having the similar issue. The splash screen is just an icon with a solid background behind it. I followed the docs correctly: Generating Icons and Splash Screens | VoltBuilder. Even removed all splash & icon and resource-files. Log:

2022-10-21T10:53:25.077Z cordova-res:platform Building splash resources for android platform
2022-10-21T10:53:25.079Z cordova-res:image Source image for splash: {
  format: 'png',
  size: 3197491,
  width: 2732,
  height: 2732,
  space: 'srgb',
  channels: 3,
  depth: 'uchar',
  density: 72,
  isProgressive: false,
  hasProfile: false,
  hasAlpha: false
}
2022-10-21T10:53:25.079Z cordova-res:platform Using '/resources/splashTemplate.png' for splash source image for android
2022-10-21T10:53:25.080Z cordova-res:image Generating 'resources/android/splash/drawable-land-ldpi-screen.png' (320x240) fit='cover' position='center'
2022-10-21T10:53:25.081Z cordova-res:image Generating 'resources/android/splash/drawable-land-mdpi-screen.png' (480x320) fit='cover' position='center'
2022-10-21T10:53:25.082Z cordova-res:image Generating 'resources/android/splash/drawable-land-xhdpi-screen.png' (1280x720) fit='cover' position='center'
2022-10-21T10:53:25.082Z cordova-res:image Generating 'resources/android/splash/drawable-land-hdpi-screen.png' (800x480) fit='cover' position='center'
2022-10-21T10:53:25.082Z cordova-res:image Generating 'resources/android/splash/drawable-land-xxhdpi-screen.png' (1600x960) fit='cover' position='center'
2022-10-21T10:53:25.083Z cordova-res:image Generating 'resources/android/splash/drawable-port-ldpi-screen.png' (240x320) fit='cover' position='center'
2022-10-21T10:53:25.083Z cordova-res:image Generating 'resources/android/splash/drawable-land-xxxhdpi-screen.png' (1920x1280) fit='cover' position='center'
2022-10-21T10:53:25.083Z cordova-res:image Generating 'resources/android/splash/drawable-port-mdpi-screen.png' (320x480) fit='cover' position='center'
2022-10-21T10:53:25.084Z cordova-res:image Generating 'resources/android/splash/drawable-port-hdpi-screen.png' (480x800) fit='cover' position='center'
2022-10-21T10:53:25.085Z cordova-res:image Generating 'resources/android/splash/drawable-port-xhdpi-screen.png' (720x1280) fit='cover' position='center'
2022-10-21T10:53:25.085Z cordova-res:image Generating 'resources/android/splash/drawable-port-xxhdpi-screen.png' (960x1600) fit='cover' position='center'
2022-10-21T10:53:25.085Z cordova-res:image Generating 'resources/android/splash/drawable-port-xxxhdpi-screen.png' (1280x1920) fit='cover' position='center'
Generated 24 resources for Android
2022-10-21T10:53:25.818Z cordova-res:cordova:config Orientation preference: undefined
2022-10-21T10:53:25.819Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@foreground][@background][@density='ldpi']" ])
2022-10-21T10:53:25.819Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@foreground][@background][@density='mdpi']" ])
2022-10-21T10:53:25.819Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@foreground][@background][@density='hdpi']" ])
2022-10-21T10:53:25.819Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@foreground][@background][@density='xhdpi']" ])
2022-10-21T10:53:25.819Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@foreground][@background][@density='xxhdpi']" ])
2022-10-21T10:53:25.820Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@foreground][@background][@density='xxxhdpi']" ])
2022-10-21T10:53:25.820Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='ldpi']" ])
2022-10-21T10:53:25.820Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='mdpi']" ])
2022-10-21T10:53:25.820Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='hdpi']" ])
2022-10-21T10:53:25.820Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xhdpi']" ])
2022-10-21T10:53:25.820Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xxhdpi']" ])
2022-10-21T10:53:25.820Z cordova-res:cordova:config Creating 'icon' node (not found by xpaths: [ "icon[@src][@density='xxxhdpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-ldpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-mdpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-hdpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xhdpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xxhdpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='land-xxxhdpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-ldpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-mdpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-hdpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xhdpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xxhdpi']" ])
2022-10-21T10:53:25.821Z cordova-res:cordova:config Creating 'splash' node (not found by xpaths: [ "splash[@density='port-xxxhdpi']" ])
Wrote to config.xml

Are you using the Microsoft Launcher?

Yes, and I have just realised that it is root cause of the problem. If I switch back to the standard launcher on my Samsung devices, the splashscreen appears. So it’s clearly Microsoft’s problem. I suspect they have not added support for splashscreen handling via Android activities. Anyway, I can now see the issue is not a VoltBuilder issue.

@wingman how did you fix this issue? I’m not using a Microsoft Launcher, I’m using the default launcher.

@jeedsx - What are you seeing? What do you expect to see? (screenshots are welcome!)

These are the things I changed in my config.xml. Most of them are lifted straight from the advice given in the VoltBuilder notes Building for Android 12, though having read additional material on the Cordova site, some changes were made, which are mentioned below.

This one is the most important!

	<engine name="android" spec="11.0.0" />

If you have an older entry like this…

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

…take it out.

I tried the Android X preference, but found it made no difference, so commented it out.

	<!--<preference name="AndroidXEnabled" value="true" />-->

These are my “min” and “target” SDK levels, you don’t need a “max” one, but level 31 or 32 for target SDK is critical for PlayStore submissions from 1 November 2022.

	<preference name="android-minSdkVersion" value="22" />
	<preference name="android-targetSdkVersion" value="32" />

Not related to splash screens, but if your app does cross domain calls, for example to web services or web socket servers, it just won’t work unless you have this entry.

	<!-- Without this entry, cross domain calls will not work.
		It allows mixed mode networking, though you'd never guess from the name-->
	<preference name="AndroidInsecureFileModeEnabled" value="true" />

Now we get to the splash screen entries

	<!-- Splash screen settings (My app's background is a dark blue, #062342)-->
	<preference name="AndroidWindowSplashScreenBackground" value="#062342" />
	<preference name="AndroidWindowSplashScreenAnimatedIcon" value="resources/splashTemplate.png" />
	<!-- My little app loads fairly quickly, so a one-second timeout is plenty-->
	<preference name="SplashScreenDelay" value="1000" />

This is irrelevant, because auto-hide is the default anyway

	<!--<preference name="AutoHideSplashScreen" value="true" />-->

As we’re now using the latest Cordova engine (see first entry above), we don’t need to use the splashscreen plugin any more.

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

Finally, remove all other resource png/jpg files from your resources folder, and make sure to remove all <splash… > tags from your config.xml. VoltBuilder notes say you can leave them in place for older version support, but that advice contradicts Cordova’s own documentation for the latest engine, which says to remove them, because it automatically handles everything, even for older Android platforms. Your experience may vary, obviously.

That’s all I did. I still don’t understand what the resources.xml file in the resources folder is supposed to do (see VoltBuilder’s Building for Android 12 notes). I tried many permutations of all the settings, but nothing made any difference.

Although I do now see a splash screen with a logo as the app starts, it’s pretty small, almost icon sized, which is a disappointment. I found I had to really reduce the logo in the splashTemplate.png file (btw forget using a jpg, it doesn’t work) so it takes up a much smaller area of the bounding rectangle, because it gets heavily clipped.

Google has some documentation on how splash screens work that is worth having a look at.