#StackBounty: #android #cordova #android-styles Cordova fails to find Theme.AppCompat.Light

Bounty: 50

I’ve set up a simple Cordova project which should display a splashscreen on Android. To utilize the whole screen I need to get rid of the statusbar by extending Theme.AppCompat.Light.
So I set up this styles.xml file and put it into the root folder of the Cordova project.

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Full" parent="@style/Theme.AppCompat.Light">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>
</resources>

Cordova’s config.xml file is like this:

    <?xml version='1.0' encoding='utf-8'?>
<widget id="com.domain.test" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Test</name>
    <description>
        Just a test
    </description>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <preference name="Fullscreen" value="true" />
    <preference name="Orientation" value="landscape" />
    <splash src="res/screen/android/splashScreen.png" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon density="mdpi" src="res/icon/android/mdpi.png" />
        <icon density="hdpi" src="res/icon/android/hdpi.png" />
        <icon density="xhdpi" src="res/icon/android/xhdpi.png" />
        <icon density="xxhdpi" src="res/icon/android/xxhdpi.png" />
        <icon density="xxxhdpi" src="res/icon/android/xxxhdpi.png" />
        <resource-file src="styles.xml" target="app/src/main/res/values/styles.xml" />
    </platform>
    <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application/activity">
        <activity android:label="@string/app_name" android:name=".ActivityName" android:theme="@style/Full" />
    </edit-config>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
    <plugin name="cordova-plugin-fullscreen" spec="^1.2.0" />
    <engine name="android" spec="~7.1.4" />
</widget>

If I try to compile the project I get these errors:

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ‘:app:processDebugResources’.
Failed to execute aapt

BUILD FAILED in 1s
cmd: Command failed with exit code 1 Error output:

error: resource style/Theme.AppCompat.Light (aka com.domain.test:style/Theme.AppCompat.Light) not found.

error: failed linking references.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.