android - 当我尝试将 mobile-center-push 添加到 React Native 项目时找不到 com.google.firebase :firebase-core:11. 0.0

标签 android firebase react-native mobile-center visual-studio-app-center

我想按照指南将推送通知集成到我的 React Native 项目中 https://mobile.azure.com/orgs/....../push/setup 当我运行时

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

看起来我需要在我的 RN 项目中升级我的 android SDK? 对此有什么想法吗? 我的安卓配置

 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
    }

我的包.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",

附言: 我找到了 firebase 提示: if i upgrade my local SDK, this is a safe update for React Native?

最佳答案

Firebase SDK 在本地存储库中,如果过时则需要更新:

enter image description here

关于android - 当我尝试将 mobile-center-push 添加到 React Native 项目时找不到 com.google.firebase :firebase-core:11. 0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44923884/

相关文章:

android - 膨胀类 android.support.v7.widget.Toolbar 时出错

android - 使用 CoordinatorLayout 时 AdView 和 FloatingActionButton 重叠

android - 和引擎一起 toast 提问?

iOS 库找不到标题

javascript - 渲染函数中 this.state 为 null

android - Android Toast 可以比 Toast.LENGTH_LONG 长吗?

android - 在 Firebase 中,我可以将一个用户连接到多个表吗?

android - Firebase 云消息服务

android - 使用 Android 的 Firebase 的子列表

ios - 从 native 代码存储时,React Native AsyncStorage 无法从 javascript 查看更新的数据