Could not find com.android.support:appcompat-v7 React Native Error Fix

Last Updated on June 30, 2018.

As you know, this Could not find com.android.support:appcompat-v7 error is very common when you are building Android apps with React Native. This error is caused when appcompat library is not downloaded when building the app. This React Native error can be fixed easily with a line of code.

All you have to do is navigate to ProjectName/android/build.gradle and change the code by adding maven{
url ‘https://maven.google.com’} as given below:

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

Now rebuild the project. If you’re still facing any error then just do gradle clean and try again.

Leave a Reply

%d bloggers like this: