teslamotors / react-native-camera-kit

A high performance, easy to use, rock solid camera library for React Native apps.
MIT License
2.49k stars 591 forks source link

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

Open aprilmintacpineda opened 3 years ago

aprilmintacpineda commented 3 years ago

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

mariobrubio commented 3 years ago

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

aprilmintacpineda commented 3 years ago

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 commented 3 years ago

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

mariobrubio commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

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.