Cdv_splashscreen_background not found on android

My app needed an update and now I had to upgrade the spec to 12.0.1

I am unable to build my android app and getting errors on the following:

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     ERROR:/platforms/android/app/build/intermediates/incremental/debug/mergeDebugResources/merged.dir/values/values.xml:1786: AAPT: error: resource color/cdv_splashscreen_background (aka coza.appname.app:color/cdv_splashscreen_background) not found.

and

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
See log for full details.
2024-02-15 03:54:08,364 - Build failed e8754b77-865f-4d9c-b6d3-849fb6032bc2
2024-02-15 03:54:09,737 - Output: 

I will send my log, config and sample project to your support email address.

I wanted to confirm that we’ve received your attachment and are looking into this.

Hi team, any feedback on the issue :slight_smile:

Apologies for the delay - we think we have a solution for you and we’re just completing our testing. I’ll have more info shortly.

The problem is in your config.xml file. You have this line:

<resource-file src="resources/values/colors.xml" target="/app/src/main/res/values/colors.xml" />

This line overwrites the default file cordova includes (which has the cdv_splashscreen_background attribute) and replaces it with your own.

If you still wish to use your own colors.xml, you will need to add the following to it:

<color name="cdv_splashscreen_background">#FFFFFFFF</color>

Be sure to replace #FFFFFFFF with the proper color from your config.xml.

A better solution would be to use an edit-config directive to modify the existing colors.xml to add your needed config, rather than replacing it entirely.

Thanks for the reply, but the below code is not in my config.xml

<resource-file src="resources/values/colors.xml" target="/app/src/main/res/values/colors.xml" />

I did send my full project to your support email a week ago if you want to review the config file.

Are you able to build my project on android?

Apologies - this line is being added by the icon generation during the build. I just tried this fix and it worked for me:

  1. Make a values folder in your resources directory.
  2. Add a file inside values called colors.xml with the following content.
<?xml version='1.0' encoding='utf-8'?>
<resources>
  <color name="cdv_splashscreen_background">#3C8DBC</color>
</resources>

Let us know if this works for you.

Success! This was the solution :slight_smile: