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.

相关问题