Frozencode
Frozencode

Reputation: 67

Could not resolve all files for configuration ':app:debugCompileClasspath'. > Could not find com.android.support:support-v4:28.1.0

Im facing this problem after upgrade react-native 0.59 to build 32 bit and 64 bit version

error when i try do run-android :

error

error when i do ./gradlew installDebug --info

error2

this my code for build.gradle

buildscript {
    repositories {
        google()
        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'
        classpath 'com.github.triplet.gradle:play-publisher:1.2.2'

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

def googlePlayServicesVersion = '15.0.1'

allprojects {
    repositories {
    google()
    mavenLocal()
    jcenter()
        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://jitpack.io" }
        maven {
            url 'https://maven.google.com'
            name 'Google'
        }
        configurations.all {
            resolutionStrategy {
                force "com.google.android.gms:play-services-vision:$googlePlayServicesVersion"
            }
        }
    }
}

ext {
    buildToolsVersion = "28.0.3"
    minSdkVersion = 16
    compileSdkVersion = 26
    targetSdkVersion = 26
    supportLibVersion = "26.1.0"
}

app/build.gradle

implementation project(':react-native-vector-icons')
    implementation project(':react-native-splash-screen')
    implementation project(':react-native-sqlite-storage')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
    implementation 'com.android.support:support-v4:28.1.0.'
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation ('com.android.support:exifinterface:26.0.0-alpha1') {
        force = true;
    }

    implementation "com.google.android.gms:play-services-base:15.0.1"
    implementation "com.google.firebase:firebase-core:16.0.1"
    implementation "com.google.firebase:firebase-messaging:17.1.0"
}

Upvotes: 0

Views: 6135

Answers (3)

Faysal Ahmed
Faysal Ahmed

Reputation: 7669

You need to update so many things in your configuration.

First, update google service version to 4.2.0 by updating this

classpath 'com.google.gms:google-services:4.2.0'

Also, update the build configuration

ext {
    buildToolsVersion = "28.0.3"
    minSdkVersion = 16
    compileSdkVersion = 28
    targetSdkVersion = 28
    supportLibVersion = "28.0.0"
}

And the dependency update

implementation 'com.android.support:appcompat-v7:28.0.0' // 28.0.0 is now live
implementation 'com.android.support:support-v4:28.0.0' // instead 28.1.0

Upvotes: 1

ianhanniballake
ianhanniballake

Reputation: 199795

There is no 28.1.0 of support-v4. The latest version of com.android.support:support-v4 is 28.0.0 as per maven.google.com:

implementation 'com.android.support:support-v4:28.0.0'

Upvotes: 0

shizhen
shizhen

Reputation: 12573

Add google() to below:

allprojects {
    repositories {
        google() // <=== here    
        jcenter()
    }
}

Upvotes: 0

Related Questions