0

I'm trying to build my react-native app but it's returning this error:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.
   > Could not find any version that matches androidx.appcompat:appcompat:28.+.
     Versions that do not match:
       - 1.1.0-rc01
       - 1.1.0-beta01
       - 1.1.0-alpha05
       - 1.1.0-alpha04
       - 1.1.0-alpha03
       - + 10 more
     Searched in the following locations:
       - file:/Users/myuser/Library/Android/sdk/extras/m2repository/androidx/appcompat/appcompat/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/m2repository/androidx/appcompat/appcompat/
       - file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/androidx/appcompat/appcompat/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/androidx/appcompat/appcompat/
       - file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/androidx/appcompat/appcompat/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/androidx/appcompat/appcompat/
       - https://jitpack.io/androidx/appcompat/appcompat/maven-metadata.xml
       - https://jitpack.io/androidx/appcompat/appcompat/
       - https://maven.google.com/androidx/appcompat/appcompat/maven-metadata.xml
       - file:/Users/myuser/.m2/repository/androidx/appcompat/appcompat/maven-metadata.xml
       - file:/Users/myuser/.m2/repository/androidx/appcompat/appcompat/
       - https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/maven-metadata.xml
       - file:/Users/myuser/myproject/node_modules/react-native/android/androidx/appcompat/appcompat/maven-metadata.xml
       - file:/Users/myuser/myproject/node_modules/react-native/android/androidx/appcompat/appcompat/
       - https://maven.google.com/androidx/appcompat/appcompat/maven-metadata.xml
       - https://jcenter.bintray.com/androidx/appcompat/appcompat/maven-metadata.xml
       - https://jcenter.bintray.com/androidx/appcompat/appcompat/
     Required by:
         project :app > project :react-native-device-info
         project :app > project :react-native-splash-screen
         project :app > project :react-native-maps
   > Could not find any version that matches androidx.legacy:legacy-support-v4:28.+.
     Versions that do not match:
       - 1.0.0
       - 1.0.0-rc02
       - 1.0.0-rc01
       - 1.0.0-beta01
       - 1.0.0-alpha3
       - + 1 more
     Searched in the following locations:
       - file:/Users/myuser/Library/Android/sdk/extras/m2repository/androidx/legacy/legacy-support-v4/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/m2repository/androidx/legacy/legacy-support-v4/
       - file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/androidx/legacy/legacy-support-v4/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/androidx/legacy/legacy-support-v4/
       - file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/androidx/legacy/legacy-support-v4/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/androidx/legacy/legacy-support-v4/
       - https://jitpack.io/androidx/legacy/legacy-support-v4/maven-metadata.xml
       - https://jitpack.io/androidx/legacy/legacy-support-v4/
       - https://maven.google.com/androidx/legacy/legacy-support-v4/maven-metadata.xml
       - file:/Users/myuser/.m2/repository/androidx/legacy/legacy-support-v4/maven-metadata.xml
       - file:/Users/myuser/.m2/repository/androidx/legacy/legacy-support-v4/
       - https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-v4/maven-metadata.xml
       - file:/Users/myuser/myproject/node_modules/react-native/android/androidx/legacy/legacy-support-v4/maven-metadata.xml
       - file:/Users/myuser/myproject/node_modules/react-native/android/androidx/legacy/legacy-support-v4/
       - https://maven.google.com/androidx/legacy/legacy-support-v4/maven-metadata.xml
       - https://jcenter.bintray.com/androidx/legacy/legacy-support-v4/maven-metadata.xml
       - https://jcenter.bintray.com/androidx/legacy/legacy-support-v4/
     Required by:
         project :app > project :react-native-device-info
         project :app > project :react-native-firebase
   > Could not find any version that matches androidx.media:media:28.+.
     Versions that do not match:
       - 1.1.0-rc01
       - 1.1.0-beta02
       - 1.1.0-beta01
       - 1.1.0-alpha04
       - 1.1.0-alpha03
       - + 9 more
     Searched in the following locations:
       - file:/Users/myuser/Library/Android/sdk/extras/m2repository/androidx/media/media/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/m2repository/androidx/media/media/
       - file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/androidx/media/media/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/androidx/media/media/
       - file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/androidx/media/media/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/androidx/media/media/
       - https://jitpack.io/androidx/media/media/maven-metadata.xml
       - https://jitpack.io/androidx/media/media/
       - https://maven.google.com/androidx/media/media/maven-metadata.xml
       - file:/Users/myuser/.m2/repository/androidx/media/media/maven-metadata.xml
       - file:/Users/myuser/.m2/repository/androidx/media/media/
       - https://dl.google.com/dl/android/maven2/androidx/media/media/maven-metadata.xml
       - file:/Users/myuser/myproject/node_modules/react-native/android/androidx/media/media/maven-metadata.xml
       - file:/Users/myuser/myproject/node_modules/react-native/android/androidx/media/media/
       - https://maven.google.com/androidx/media/media/maven-metadata.xml
       - https://jcenter.bintray.com/androidx/media/media/maven-metadata.xml
       - https://jcenter.bintray.com/androidx/media/media/
     Required by:
         project :app > project :react-native-device-info
   > Could not find any version that matches androidx.exifinterface:exifinterface:28.+.
     Versions that do not match:
       - 1.1.0-beta01
       - 1.1.0-alpha01
       - 1.0.0
       - 1.0.0-rc02
       - 1.0.0-rc01
       - + 3 more
     Searched in the following locations:
       - file:/Users/myuser/Library/Android/sdk/extras/m2repository/androidx/exifinterface/exifinterface/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/m2repository/androidx/exifinterface/exifinterface/
       - file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/androidx/exifinterface/exifinterface/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/androidx/exifinterface/exifinterface/
       - file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/androidx/exifinterface/exifinterface/maven-metadata.xml
       - file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/androidx/exifinterface/exifinterface/
       - https://jitpack.io/androidx/exifinterface/exifinterface/maven-metadata.xml
       - https://jitpack.io/androidx/exifinterface/exifinterface/
       - https://maven.google.com/androidx/exifinterface/exifinterface/maven-metadata.xml
       - file:/Users/myuser/.m2/repository/androidx/exifinterface/exifinterface/maven-metadata.xml
       - file:/Users/myuser/.m2/repository/androidx/exifinterface/exifinterface/
       - https://dl.google.com/dl/android/maven2/androidx/exifinterface/exifinterface/maven-metadata.xml
       - file:/Users/myuser/myproject/node_modules/react-native/android/androidx/exifinterface/exifinterface/maven-metadata.xml
       - file:/Users/myuser/myproject/node_modules/react-native/android/androidx/exifinterface/exifinterface/
       - https://maven.google.com/androidx/exifinterface/exifinterface/maven-metadata.xml
       - https://jcenter.bintray.com/androidx/exifinterface/exifinterface/maven-metadata.xml
       - https://jcenter.bintray.com/androidx/exifinterface/exifinterface/
     Required by:
         project :app > project :react-native-camera

my build.gradle file has:

android.useAndroidX=true
android.enableJetifier=true

my app/build.gradle file has:

implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"

I also tried with:

implementation "com.android.support:appcompat-v7:28.+"

opening the project in Android Studio the button "Migrate to AndroidX" doesn't appear.

what am I doing wrong?

sorry I'm very newbie to java and have no idea on how to deal with that :(


here is my build.gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 23
        compileSdkVersion = 28
        targetSdkVersion = 26
        supportLibVersion = "28.0.0"
        playServicesVersion = "16.0.0"
    }
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath 'com.google.gms:google-services:4.0.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
        mavenLocal()
        google()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        jcenter()
    }
}

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "28.0.0"
            }
        }
    }
    afterEvaluate {
        android {
            compileSdkVersion 28
            buildToolsVersion "27.0.3"

            defaultConfig {
                targetSdkVersion 27
            }
        }
    }
}

ext {
    buildToolsVersion = "27.0.3"
    minSdkVersion = 16
    compileSdkVersion = 28
    targetSdkVersion = 27
    supportLibVersion = "27.1.0"
}
Martin Zeitler
  • 1
  • 19
  • 155
  • 216
anderlaini
  • 1,593
  • 2
  • 24
  • 39

3 Answers3

0

most likely, without having seen the build.gradle, the full version number might be migrated:

implementation "com.android.support:appcompat-v7:28.0.0"
Martin Zeitler
  • 1
  • 19
  • 155
  • 216
0

try this,

implementation "com.android.support:appcompat-v7:28.0.0"

after 28.0.0 appcompat converted into androidx , so "androidx.....:1.0.0" is it self implementation "com.android.support:appcompat-v7:29.0.0"

support:appcompat is not allowed greater than "28.0.0"

0

The Android studio provide a option to migrate existing android project to Androidx in the menu bar Menu->Refactor-Migrate To AndroidX

Vijay Sonawane
  • 122
  • 1
  • 5