Android Core Library Error

Android Studio library error: mixing versions can lead to runtime crashes and @android:style/ missing resources name

I hope this will work for you.

For first issue:

This issue occur because you setting somewhere 26.1.0 as library version and compileSdkVersion 26.

If you are using 28.0.0 as your library version then use this library version where it applicable.

Check once in every gradle file that your project have and make compileSdkVersion 28 and targetSdkVersion 28

For second issue:

change minSdkVersion 17 to minSdkVersion 21.

--core-library error with build tools android (Eclipse)[solved with android studio]

So finally , I moved to android studio as no luck building it with eclipse.
And it runs great.

How can I resolve the error The minCompileSdk (31) specified in a dependency's AAR metadata in native Java or Kotlin?

I have found the solution. Enter this line of code above package in the app Gradle file.

For Kotlin developers:

configurations.all {
resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' }
}

Screenshot of code with a red freehand circle

For Java developers

configurations.all {
resolutionStrategy { force 'androidx.core:core:1.6.0' }
}

Android Studio 4.0.0 Java 8 library desugaring in D8 and R8 Build Error

I encountered the same issue after I upgraded the coreLibraryDesugaring in build.gradle to com.android.tools:desugar_jdk_libs:1.0.6. My app was building fine until I did that dependency update. A suggestion popped up two hours ago when I passed by build.gradle and I just followed suit.

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.6'
}

I reverted the dependency back to com.android.tools:desugar_jdk_libs:1.0.5 and the issue magically disappeared.

dependencies {
//noinspection GradleDependency
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.5'
}

From this, I think that it is likely a bug with the compatibility of the new version of the dependency with the IDE (maybe an IDE update may follow up to resolve the issue, I don't know). Maybe we need to report it as an issue to Google, I have not tried that yet. :D

Actually, I created this Stack Overflow account just now to share this after I saw your post when I searched for a solution to my problem. :)

Update

As mentioned by @sgjesse from the R8 team, the changes from 1.0.5 to 1.0.6 are already reverted in the release of 1.0.7 to fix this issue, so 1.0.5 and 1.0.7 are just the same. See @sgjesse's answer for more details.

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.7'
}

I moved to 1.0.7 to remove the warning on outdated dependency version. :)

P.S. I can't comment because I don't have 50 reputation yet. Thanks, @sgjesse! :)



Related Topics



Leave a reply



Submit