1

我想推送通知整合到我的陣營本地項目遵循的指導 https://mobile.azure.com/orgs/....../push/setup 當我運行找不到com.google.firebase:火力核心:11.0.0當我嘗試添加移動中心推反應本地項目

react-native run-android 

我得到了一個錯誤:

-> % 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 

它看起來像我需要升級我的Android SDK在我的RN的項目? 有關於此的任何想法? 我的Android配置

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 
    } 

我的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: 我找到火力提示: if i upgrade my local SDK, this is a safe update for React Native?

回答

2

的火力地堡SDK是在您需要更新,如果過時的本地存儲庫:

enter image description here

+0

我可以升級我的本地SDK,做這意味着我應該升級我的build.gradle。 「compileSdkVersion 23」到其他版本,這對React Native是否安全? – kala888

+0

您應該閱讀以下內容:https://medium.com/google-developers/picking-your-compilesdkversion-minsdkversion-targetsdkversion-a098a0341ebd –

0

看起來你缺少相關的火力地堡的一個步驟。請確保您已完成說明的所有步驟。

documentation

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

相關問題