Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change implementation "androidx.core:core-ktx:+" to a specific version #422

Open
aprilmintacpineda opened this issue Sep 5, 2021 · 10 comments

Comments

@aprilmintacpineda
Copy link

Issue Description

a new version of androidx.core:core-ktx has just been released last September 1. The new version has targetSdkVersion: 31. When I tried to run my android app I got error message:

* What went wrong:
Execution failed for task ':app:checkDevDebugAarMetadata'.
> Multiple task action failures occurred:
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > The minCompileSdk (31) specified in a
        dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
        is greater than this module's compileSdkVersion (android-30).
        Dependency: androidx.core:core-ktx:1.7.0-alpha02.
        AAR metadata file: /Users/me/.gradle/caches/transforms-2/files-2.1/ed22ee8b86d25659bbef1e9ee203b75c/jetified-core-ktx-1.7.0-alpha02/META-INF/com/android/build/gradle/aar-metadata.properties.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > The minCompileSdk (31) specified in a
        dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
        is greater than this module's compileSdkVersion (android-30).
        Dependency: androidx.core:core:1.7.0-alpha02.
        AAR metadata file: /Users/me/.gradle/caches/transforms-2/files-2.1/23234efc7e9de9bfe6a3fea85a6072ef/core-1.7.0-alpha02/META-INF/com/android/build/gradle/aar-metadata.properties.

This is because implementation "androidx.core:core-ktx:+" will install the latest release even though it may not yet be compatible with some other dependencies.

https://androidx.tech/artifacts/core/core-ktx/1.7.0-alpha02

Steps to Reproduce / Code Snippets / Screenshots

N/A


Environment

  • React Native Navigation version: N/A
  • React Native version: 0.64
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): N/A
wilkuintheair added a commit to wilkuintheair/react-native-camera-kit that referenced this issue Sep 6, 2021
@mariobrubio
Copy link

Same here, could you please change the version of androidx.core:core-ktx? My app is not building because of this

@aprilmintacpineda
Copy link
Author

aprilmintacpineda commented Sep 6, 2021

As a workaround, in your android/app/build.gradle add the following block before android {} block.

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

@mariobrubio
Copy link

@aprilmintacpineda I did it and it is still failing when trying to build my pipeline.

@mariobrubio
Copy link

image

This is the error that my CI is throwing, I tried to globally change the resolutionStrategy to accept only alpha01 and 1.6.0 versions but it didn't work.

@aprilmintacpineda
Copy link
Author

image

This is the error that my CI is throwing, I tried to globally change the resolutionStrategy to accept only alpha01 and 1.6.0 versions but it didn't work.

I think that error is not related to this, try building in android studio so you can see more details.

@mariobrubio
Copy link

If I build in android studio or locally I have to change the build.gradle of react-native-camera-kit to implementation "androidx.core:core-ktx:1.6.0" instead of implementation "androidx.core:core-ktx:+" and then it works like a charm. Meanwhile in my CI workflow I can't change the dependency implementation of the androidx.core, so it fails... Tried to globally change the dependency implementation but didn't work

@V-in
Copy link

V-in commented Sep 20, 2021

This broke multiple projects for me as well. Adding the following snippet at the top of my app/build.gradle solves it:

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

@mariobrubio
Copy link

This broke multiple projects for me as well. Adding the following snippet at the top of my app/build.gradle solves it:

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

Apparently it solves it locally, but when you're building to a CI/CD pipeline, it keeps failing

@V-in
Copy link

V-in commented Sep 20, 2021

This broke multiple projects for me as well. Adding the following snippet at the top of my app/build.gradle solves it:

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

Apparently it solves it locally, but when you're building to a CI/CD pipeline, it keeps failing

Are you sure this isn't a caching problem

@supratechadmin
Copy link

there is a workaround for this I upgraded my versions to 31 and its done
compileSdkVersion = 31
targetSdkVersion = 31
P.S : Nothing else worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants