1

I want integrate the push notification to my React Native project follow the guide https://mobile.azure.com/orgs/....../push/setup and when i run

react-native run-android

i got an error:

-> % react-native run-android
Scanning 744 folders for symlinks in /Users/kalaliu/temp/RNBase/node_modules (5ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
File /Users/kalaliu/.android/repositories.cfg could not be loaded.

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 ':mobile-center-push'.
      > Could not resolve all dependencies for configuration ':mobile-center-push:_debugPublishCopy'.
         > Could not find com.google.firebase:firebase-core:11.0.0.
           Required by:
               RNBase:mobile-center-push:unspecified > com.microsoft.azure.mobile:mobile-center-push:0.10.0
         > Could not find com.google.firebase:firebase-messaging:11.0.0.
           Required by:
               RNBase:mobile-center-push:unspecified > com.microsoft.azure.mobile:mobile-center-push:0.10.0

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

BUILD FAILED

it looks like that i need upgrade my android SDK in my RN project? any idea about this? my android configuration

 compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.rnbase"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0.1"
        ndk {
            abiFilters "armeabi-v7a"
        }
        vectorDrawables.useSupportLibrary = true
    }

my package.json

"mobile-center": "^0.6.0",
"mobile-center-analytics": "^0.6.0"
"mobile-center-crashes": "^0.6.0",
"mobile-center-push": "^0.7.0",
"react": "16.0.0-alpha.12",
"react-native": "^0.45.1",

PS: i find the firebase tips: if i upgrade my local SDK, this is a safe update for React Native?

Brandon Minnick
  • 13,342
  • 15
  • 65
  • 123
kala888
  • 119
  • 2
  • 8

2 Answers2

3

The Firebase SDK is in a local repository that you need to update if outdated:

enter image description here

Guillaume Perrot
  • 4,278
  • 3
  • 27
  • 37
  • I can upgrade my local SDK and do this mean i should upgrade my build.gradle. "compileSdkVersion 23" to other version, does this safe for React Native? – kala888 Jul 06 '17 at 03:43
  • You should read this then: https://medium.com/google-developers/picking-your-compilesdkversion-minsdkversion-targetsdkversion-a098a0341ebd – Guillaume Perrot Jul 06 '17 at 07:31
0

Looks like you are missing a step related to Firebase. Please make sure that you have completed all steps of the instructions.

From the documentation:

Before using Mobile Center Push service, you need to add Firebase to your application.

Lukas Spieß
  • 2,478
  • 2
  • 19
  • 24
Ivan
  • 673
  • 7
  • 15