skip to Main Content

My project on React Native. After 24 August i have this problem.
How fix it?

* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
   > Failed to transform annotation-experimental-1.3.0-rc01.aar (androidx.annotation:annotation-experimental:1.3.0-rc01) to match attributes {artifactType=jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Execution failed for JetifyTransform: C:Userstwent.gradlecachesmodules-2files-2.1androidx.annotationannotation-experimental1.3.0-rc0121f058f7e73e25cb36ea7093686ec9334f5b588eannotation-experimental-1.3.0-rc01.aar.
         > Failed to transform 'C:Userstwent.gradlecachesmodules-2files-2.1androidx.annotationannotation-experimental1.3.0-rc0121f058f7e73e25cb36ea7093686ec9334f5b588eannotation-experimental-1.3.0-rc01.aar' using Jetifier. Reason: null. (Run with --stacktrace for more details.)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings

What i try to do:

  1. Disable jetifier (jetifier = false);

  2. Next – add in build.gradle:

packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude("META-INF/*.kotlin_module")
        exclude 'androidsupportmultidexversion.txt'
      }  

packagingOptions{
     pickFirst "androidsupportmultidexversion.txt"
  }
  1. minSdkVersion 21 in build.gradle (android)

  2. add classpath("com.android.tools:r8:1.6.84") in build.gradle (android)

  3. Add gradle.properties
    android.minifyEnabled=false
    adnroid.shrinkResources=false

  4. But this not help, and have many errors 😉

3

Answers


    1. Change distribution url in graddle wrapper

    distributionUrl=https://services.gradle.org/distributions/gradle-6.8.1-all.zip

    1. update build tools in build.gradle under dependencies{}

    classpath("com.android.tools.build:gradle:4.1.3")

    1. add and change this under buildscript{} ext{}
    minSdkVersion = 21
    compileSdkVersion = 31
    targetSdkVersion = 31
    androidXCore = "1.5.0"
    
    Login or Signup to reply.
  1. try this:

    add
    implementation "androidx.annotation:annotation-experimental:1.3.0-rc01" in app/build.gradle under dependencies{}

    Login or Signup to reply.
  2. If for some reason you don’t want to upgrade your SDK as @Jonathan Suhangita suggested. You can override the version to a stable one by inserting this in your app-level build.gradle:

    configurations.all {
      resolutionStrategy {
        force "androidx.annotation:annotation-experimental:1.2.0"
      }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search