1

I woke up this morning, no code has been committed or pushed and I attempted to run a build but suddenly my build failed to give me the following error:

enter image description here

I tried updating Android Studio but that didn't work.

I looked online to check this android:attr/lStar but I could only find something related to react which I'm not using (my project is an Ionic angular application)

I am really puzzled about this has anyone tried this before?

I am using Cordova and the android version is 9.0.0

Abit more info

This is built using the command cordova build android the command that files is:

/Users/admin/myagent/_work/3/s/platforms/android/gradlew cdvBuildDebug -b /Users/admin/myagent/_work/3/s/platforms/android/build.gradle

so cdvBuildDebug -b

Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364

1 Answers1

2

Solution 1

Just open your app/build.gradle file and change this line.

androidx.core:core-ktx:+

replace with

androidx.core:core-ktx:1.6.0

Here is an Example:

ext {
    buildToolsVersion = "29.0.2"
    minSdkVersion = 21
    compileSdkVersion = 29
    targetSdkVersion = 29
    googlePlayServicesAuthVersion = "16.0.1"
    androidXCore = "1.6.0"
}

Solution 2

upgrade the compile SDK to Android 31 If you are using androidx.core:core-ktx:+ then this will find the latest version of androidx.core:core-ktx:+ and the latest one is 1.7.0 and the latest version needs the Android 31 compile SDK. So that You are facing this issue.

Here is Two Possible Solution:

1- use a specific version, use androidx.core:core-ktx:${version} instead of androidx.core:core-ktx:+

2- upgrade the compile SDK to Android 31

for more information you can see this article from here.

Louay Sleman
  • 1,794
  • 2
  • 15
  • 39
  • in my app/build.gradle file i dont have any where where it says ktx or androidCore :S I have updated my build tools in android sdk – Marc Rasmussen Sep 30 '21 at 17:19
  • i have updated my question with a bit more info – Marc Rasmussen Sep 30 '21 at 17:25
  • if you couldn't find `androidx.core:core-ktx:+` can you check for `ext ` object and add the `androidXCore = "1.6.0"` to it, I had this problem from a few months in my ionic app and that's how I fix it can you check it? – Louay Sleman Sep 30 '21 at 17:44
  • i added it but got same error :( – Marc Rasmussen Sep 30 '21 at 17:56
  • I found this question that have a similar issue you can check it and I'll search for it to help as much as I could I know this errors can drive someone crazy :( https://stackoverflow.com/questions/69021225/resource-linking-fails-on-lstar/69395334#69395334 – Louay Sleman Sep 30 '21 at 18:11
  • 1
    Loauy so i found the problem in the android folder there is a file name project.properties where there was this + sign in front of a version this file is generated with cordova do you know how I can edit that so that cordova generates a correct file? – Marc Rasmussen Sep 30 '21 at 18:45
  • I'm not 100% sure but I think you can use `edit-config` method to edit the file using `config.xml` you can check this link https://stackoverflow.com/questions/45554790/edit-config-is-not-working-in-config-xml-in-cordova – Louay Sleman Sep 30 '21 at 18:55
  • Or you can try to check what is the plugin that add it to your project and make a patch for it so it'll work everytime without need to edit. – Louay Sleman Sep 30 '21 at 18:57
  • the plugin is called androidx.appcompat:appcompat do you know how I can change this so I don't have to do it every time it updates – Marc Rasmussen Sep 30 '21 at 19:03
  • solution2 was the way to go for me! thanks thousand times!! – berlindev Oct 27 '21 at 08:24