OneSignal / react-native-onesignal

React Native Library for OneSignal Push Notifications Service
Other
1.57k stars 373 forks source link

Could not resolve all dependencies for configuration ':app:_debugApkCopy' #660

Closed Jvictor97 closed 5 years ago

Jvictor97 commented 5 years ago

Description:

I'm getting the following when trying to run my project on Android:

$ react-native run-android
Scanning folders for symlinks in C:\[project path]\ReactNative_PushNotifications\oneSignalApp\node_modules (145ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
   > Could not find any matches for com.google.firebase:firebase-iid-license:[10.2.1,12.1.0[ as no versions of com.google.firebase:firebase-iid-license are available.
     Required by:
         oneSignalApp:app:unspecified > oneSignalApp:react-native-onesignal:unspecified > com.onesignal:OneSignal:3.10.1 > com.google.firebase:firebase-messaging:11.0.4 > com.google.firebase:firebase-iid:11.8.0
   > Could not find any matches for com.google.firebase:firebase-common-license:[10.2.1,12.1.0[ as no versions of com.google.firebase:firebase-common-license are available.
     Required by:
         oneSignalApp:app:unspecified > oneSignalApp:react-native-onesignal:unspecified > com.onesignal:OneSignal:3.10.1 > com.google.firebase:firebase-messaging:11.0.4 > com.google.firebase:firebase-common:11.8.0

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

BUILD FAILED

Total time: 40.528 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Environment

Steps to Reproduce Issue:

  1. I've installed and linked the react native SDK
  2. I've added the code to my Manifest file and build.gradle file as recommended in the docs

Obs.: this project was a test I made using OneSignal and it was working until last week, so I guess the problem may have to do with some third party update

kivervinicius commented 5 years ago

Hello, this issue with me to, another minutes i execute and work, but another time dont work.

kivervinicius commented 5 years ago

resolved?

iLevye commented 5 years ago

same here.

 "react": "16.3.1",
    "react-native": "0.55.2",
    "react-native-onesignal": "^3.2.7"

I just back to react-native-onesignal@3.1.4 and added fcm parameters in android/app/build.gradle

android {
    ...
    defaultConfig {
        ...
        manifestPlaceholders = [onesignal_app_id: "app-id",
                                        onesignal_google_project_number: "sender"]
    }
jkasten2 commented 5 years ago

Can you try updating to the latest 0.12.1 version of the OneSignal-Gradle-Plugin? An update was just released this week which might fix this issue. https://documentation.onesignal.com/docs/react-native-sdk-setup#section-adding-the-gradle-plugin

Also double check you have setup this plugin in the correct build.gradle in the correct spot to make sure it is running.

Please attach a project reproducing the issue if this does not help.

Jvictor97 commented 5 years ago

I double checked the build.gradle as requested and everything seems fine. Also tried updating the gradle plugin but the error is still happening. I've created a repo with a copy of my project just remember to add you OneSignal AppID on App.js before testing.

Here it is: https://github.com/Jvictor97/OneSignalTesting

hkanizawa commented 5 years ago

Same issue here.

I created this project and everything was working last month, but now isn't work anymore.

Error message: Could not find any matches for com.google.firebase:firebase-iid-license:[10.2.1,12.1.0[ as no versions of com.google.firebase:firebase-iid-license are available.

hkanizawa commented 5 years ago

I can solve it by adding maven url to android/build.gradle repositories:

maven {
            url 'https://maven.google.com'
        }

The full code:

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 it is building normally, but don't registering user to Onesignal's App.

Jvictor97 commented 5 years ago

I tried @iLevye 's approach and it worked. But I see it as a temporary solution. Something should be done to version 3.2.7 so it can work properly.

jkasten2 commented 5 years ago

@Jvictor97 @iLevye maven { url 'https://maven.google.com' } or google() should be added automatically by react native. It is needed to get any version of Google Play services or Firebase released in the last 9 months. It is also already in our example project. https://github.com/geektimecoil/react-native-onesignal/blob/3.2.7/examples/RNOneSignal/android/build.gradle#L19

Nightsd01 commented 5 years ago

Closing due to no response, assuming jkasten's response fixed your issue.