0

So I'm building a JAVA-based Android application for touchscreen boards. We currently have two board models, the newer boards, which run ok SDK 24, and the older boards, running on SDK 21. I originally built this application for the newer boards and had it working. When I went to do the other boards I started running into problems. These were mainly to do with a lot of code that is provided in SDK 24 but not in SDK 21. I learned about the de-sugaring process and I was able to get an early version of my application to work with all the login working correctly, and having to change some libraries and some GUI declarations. I continued working on the application and got it to a new release where I added one more screen and a few buttons. This is where I run into this problem:

Android resource linking failed
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Inverse not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v26/values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
error: resource android:style/Widget.Material.Button.Colored not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v23/values-v23.xml:39: error: resource android:attr/colorBackgroundFloating not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values-v23/values-v23.xml:39: error: resource android:attr/colorBackgroundFloating not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values/values.xml:3238: error: resource android:attr/fontStyle not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values/values.xml:3239: error: resource android:attr/font not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values/values.xml:3240: error: resource android:attr/fontWeight not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values/values.xml:3241: error: resource android:attr/fontVariationSettings not found.
org.newroads.boardconnectionsclient.app-mergeDebugResources-11:/values/values.xml:3242: error: resource android:attr/ttcIndex not found.

So, based on my research, all the declarations that neem to be missing are for Button decorations and how they display. Now, I had to make some changes to the gradle to work. My original SDK 24 gradle is:

android {
    namespace 'org.newroads.boardconnectionsclient'
    compileSdk 28
    lintOptions {
        abortOnError false
        disable 'ExpiredTargetSdkVersion'
    }
    defaultConfig {
        applicationId "org.newroads.boardconnectionsclient"
        minSdk 21
        targetSdk 26
        versionCode 5
        versionName "1.3"
        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a", "x86_64", "x86"
        }

    }

dependencies {

    implementation 'androidx.leanback:leanback:1.0.0'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.pusher:pusher-java-client:2.4.4'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.google.android.exoplayer:exoplayer:2.15.1'
}

And my SDK 21 is now:

android {
    namespace 'org.newroads.boardconnectionsclient'
    compileSdk 21
    lintOptions {
        abortOnError false
        disable 'ExpiredTargetSdkVersion'
    }
    defaultConfig {
        applicationId "org.newroads.boardconnectionsclient"
        minSdk 21
        targetSdk 21
        multiDexEnabled true
        versionCode 5
        versionName "1.3"
        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a", "x86_64", "x86"
        }

    }

    compileOptions {
        // Flag to enable support for the new language APIs
        coreLibraryDesugaringEnabled true
        // Sets Java compatibility to Java 8
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.pusher:pusher-java-client:2.4.4'
    implementation 'com.android.support:appcompat-v7:21.0.3'
    implementation 'com.android.support:cardview-v7:21.0.3'
    implementation 'com.android.support.constraint:constraint-layout:2.0.4'
    implementation 'com.google.android.exoplayer:exoplayer-core:2.15.1'
    implementation 'com.google.android.exoplayer:exoplayer-ui:2.15.1'
}

I've gone through all my GUI declarations, which only happen in two files, and updated my themes.xml to be:

<resources>

    <style name="Theme.BoardConnectionsClient" parent="@style/Theme.AppCompat" />
</resources>

I have tried overriding themes on buttons as well as other elements, but I'm not sure why the error is there. Funny enough it didn't happen on my original test, it only seems to be happening now. Most answers like this one (such as this one, or this one), all pretty much advise to bump up the SDK compiling version. I'm unfortunately not able to do this since the board won't run that code. Plus it all seems to be related to the "look" of the application, which is something that I'm willing to change.

Any help is appreciated! Thank you!!

German
  • 99
  • 1
  • 3

0 Answers0