calcazar / react-native-push-notification-CE

The community edition of the push notification library (by Zo0r) for applications made with React Native
MIT License
52 stars 23 forks source link

Could not find support-vector-drawable.jar (com.android.support:support-vector-drawable:26.0.2) #14

Closed fluvios closed 6 years ago

fluvios commented 6 years ago

hello, i have this issues

Total time: 11.185 secs
PS E:\Mobile\android> .\gradlew clean
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html.
Incremental java compilation is an incubating feature.
WARNING: Module 'com.android.support:support-vector-drawable:26.0.2' depends on one or more Android Libraries but is a jar

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':react-native-push-notification-ce'.
      > Could not find support-vector-drawable.jar (com.android.support:support-vector-drawable:26.0.2).
        Searched in the following locations:
            https://jcenter.bintray.com/com/android/support/support-vector-drawable/26.0.2/support-vector-drawable-26.0.2.jar

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

when i go to that library, the file is 404. so how i solve this depedency ?

MarsWang42 commented 6 years ago

+1 I'm facing the same issue, how can this be fixed?

fluvios commented 6 years ago

@Marswang92 after i check some solution, the problem is sequence of repositories in build.gradle.

this my sequence

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

also, the dependencies in app build.gradle its like this

dependencies {
    compile project(':react-native-pusher-push-notifications')
    compile project(':react-native-push-notification-ce')    
    compile project(':react-native-splash-screen')
    compile project(':react-native-vector-icons')
    compile project(':react-native-share')
    compile project(':react-native-image-picker')
    compile project(':react-native-google-signin')
    compile project(':react-native-code-push')
    compile project(':react-native-pdf')
    compile project(':react-native-fetch-blob')
    compile(project(':react-native-maps')){
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
        exclude group: 'com.google.android.gms', module: 'play-services-gcm'
    }
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile 'com.android.support:support-v4:26.0.2'
    compile 'com.android.support:appcompat-v7:26.0.2'
    compile 'com.google.android.gms:play-services-base:+'
    compile 'com.google.android.gms:play-services-maps:+'
    compile 'com.google.android.gms:play-services-gcm:+'
    compile "com.google.firebase:firebase-messaging:+"
    compile "com.facebook.react:react-native:+"  // From node_modules
}

and add this in the end of file in app build.gradle

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '26.0.2'
            }
        }
    }
}