Support of AndroidX for native PlugIns?

Hi all,

when will there be a support for AndroidX?

My planned PlugIn is depending on a 3rd party SDK which uses AndroidX.
I inlcuded all required dependecies like
implementation "androidx.appcompat:appcompat:1.2.0"

But when it comes to Build the Android version through Corona Simulator, the log lists a lot of errors regarding attr:xxx, style:xxx not found. All those styles are coming with androidx.appcompat.

I am using the latest Project Template “2020.3627” and the code is running welll within the Android Studio using the app provided by the project template.

I am clueless how to solve this issue, so any hint is appreciated.
Markus

2: Task failed with an exception.
                -----------
                * What went wrong:
                Execution failed for task ':App:processReleaseResources'.
                > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
                   > Android resource linking failed
                     /Users/markusthies/.gradle/caches/transforms-2/files-2.1/70d3a7826a07d7707acde11f18323222/jetified-plugin-release/res/values/values.xml:333:5-338:13: AAPT: error: style attribute 'attr/colorAccent (aka de.explorative.solar2d.bluecode.BlueCodeTest:attr/colorAccent)' not found.
                         
                     /Users/markusthies/.gradle/caches/transforms-2/files-2.1/70d3a7826a07d7707acde11f18323222/jetified-plugin-release/res/values/values.xml:333:5-338:13: AAPT: error: style attribute 'attr/colorPrimary (aka de.explorative.solar2d.bluecode.BlueCodeTest:attr/colorPrimary)' not found.
                         
                     /Users/markusthies/.gradle/caches/transforms-2/files-2.1/70d3a7826a07d7707acde11f18323222/jetified-plugin-release/res/values/values.xml:333:5-338:13: AAPT: error: style attribute 'attr/colorPrimaryDark (aka de.explorative.solar2d.bluecode.BlueCodeTest:attr/colorPrimaryDark)' not found.
                         
                     /Users/markusthies/.gradle/caches/transforms-2/files-2.1/70d3a7826a07d7707acde11f18323222/jetified-plugin-release/res/values/values.xml:360:5-365:13: AAPT: error: style attribute 'attr/windowActionBar (aka de.explorative.solar2d.bluecode.BlueCodeTest:attr/windowActionBar)' not found.
                         
                     /Users/markusthies/.gradle/caches/transforms-2/files-2.1/70d3a7826a07d7707acde11f18323222/jetified-plugin-release/res/values/values.xml:370:5-372:13: AAPT: error: style attribute 'attr/colorAccent (aka de.explorative.solar2d.bluecode.BlueCodeTest:attr/colorAccent)' not found.
                         
                     /Users/markusthies/.gradle/caches/transforms-2/files-2.1/70d3a7826a07d7707acde11f18323222/jetified-plugin-release/res/values/values.xml:557:5-561:13: AAPT: error: resource style/ThemeOverlay.AppCompat.Light (aka de.explorative.solar2d.bluecode.BlueCodeTest:style/ThemeOverlay.AppCompat.Light) not found.

This is my gradle build definition (project):

dependencies {
    classpath("com.android.tools.build:gradle:4.1.1")
    classpath("com.beust:klaxon:5.0.1")
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
    classpath("com.kezong:fat-aar:1.2.20")
}

This is my gradle build definition (:plugin):

dependencies {
implementation ':Corona@aar'

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.appcompat:appcompat:1.2.0-alpha03"
implementation "androidx.percentlayout:percentlayout:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.multidex:multidex:2.0.0'

implementation "com.google.android.material:material:1.0.0"

implementation 'com.wang.avi:library:2.1.3'

embed "at.bluecode.sdk:ui:$VersionBlueCodeSDK"
embed "at.bluecode.sdk:token:$VersionBlueCodeSDK"
embed "at.bluecode.sdk:bluetooth:$VersionBlueCodeSDK"
embed "at.bluecode.sdk:core:$VersionBlueCodeSDK"
embed "at.bluecode.sdk:core-network:$VersionBlueCodeSDK"

// Kotlin Standard Library
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

// kotlin reflection
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
}

In addition to the question above, this topic is also related to multiple AAR files (please see my other question: Plugin depends on multiple frameworks (AAR files)).

But that one I guess could be solved by using a special plugin (com.kezong:fat-aar:1.2.20) which produces one fat aar file out of the dependencies.

No need for a fat-aar file :slight_smile:

I got feedback from @vlads to easily add all dependecies even AndroidX dependencies.

Currently I am updating the documentation of the Corona-Site and create Pull-Request, so that this information is available to the community.

1 Like