【问题标题】:REACT NATIVE Could not find com.google.firebase:firebase-iid:. New update from iid broke the projectREACT NATIVE 找不到 com.google.firebase:firebase-iid:。 iid 的新更新破坏了该项目
【发布时间】:2020-10-28 22:12:26
【问题描述】:

首先提供一些信息:这不是我的工作站,这台笔记本归我工作的公司所有,我确实有一些访问权限。

环境有些东西很奇怪,但我们可以工作,我不是唯一一个环境有问题的人,但我认为这与 env 无关,但与最新的 iid 更新有关。

我必须通过两个终端来启动项目

  • sudo su 的使用是为了防止我们环境中的一些错误

    1 > [sudo su] yarn react-native start
    2 > [sudo su] yarn android:android:debug
    

导致此错误:

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.google.firebase:firebase-iid:.
     Required by:
         project :app > project :@react-native-firebase_iid

**import info :@react-native-firebase_iid 于昨天 2020 年 7 月 7 日收到更新 所以在那之前一切正常

跟随 package.json 文件

  "dependencies": {
    "@react-native-community/async-storage": "^1.6.1",
    "@react-native-community/netinfo": "^5.6.2",
    "@react-native-firebase/analytics": "^6.1.0",
    "@react-native-firebase/app": "^6.1.0", DOWNGRADING DID NOT HELP ( version bellow )
    "@react-native-firebase/iid": "^6.3.4", DOWNGRADING DID NOT HELP ( version bellow )
    "axios": "^0.19.0",
    "native-base": "^2.13.1",
    "prop-types": "^15.7.2",
    "react": "16.8.6",
    "react-native": "^0.60.4",
    "react-native-barcode-builder": "^1.0.5",
    "react-native-config": "^0.12.0",
    "react-native-dialog": "^5.6.0",
    "react-native-elements": "^1.2.0",
    "react-native-flip-card": "^3.5.5",
    "react-native-geolocation-service": "^3.1.0",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-image-picker": "^1.1.0",
    "react-native-keychain": "^3.1.3",
    "react-native-map-link": "^2.5.1",
    "react-native-maps": "^0.25.0",
    "react-native-masked-text": "^1.13.0",
    "react-native-screens": "^2.3.0",
    "react-native-splash-screen": "^3.2.0",
    "react-native-touch-id": "^4.4.1",
    "react-native-vector-icons": "^6.6.0",
    "react-navigation": "^3.11.1",
    "uninstall": "0.0.0"
  },

yarn list --pattern "@react-native-firebase" 结果

yarn list v1.22.4
├─ @react-native-firebase/analytics@6.7.2
├─ @react-native-firebase/app-types@6.7.1
├─ @react-native-firebase/app@6.7.1
└─ @react-native-firebase/iid@6.7.1
Done in 0.49s.

以下与此问题类似的另一个问题给了我这些选项

rm -rf node_modules/
rm -rf yarn.lock
./gradlew clean
yarn react-native link react-native-firebase
yarn react-native start --reset-cache
tryng to sync the android project on android studio
IOS also having problems
following the iid instalation to react native from firebase

没有成功,很遗憾

yarn react-native link react-native-firebase 结果

        $ /home/raiadrogasil.com/kamoraes/Workspace/ProjetosRd/univers-app-react/node_modules/.bin/react-native link react-native-firebase
        warn The following packages use deprecated "rnpm" config that will stop working from next release:
          - react-native-maps: https://npmjs.com/package/react-native-maps
        Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
        error Unknown dependency. Make sure that the package you are trying to link is already installed in your "node_modules" and present in your "package.json" dependencies. Run CLI with --verbose flag for more details.
        error Command failed with exit code 1.
        info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```

settings.gradle

    rootProject.name = 'universAppReact'
    include ':react-native-touch-id'
    project(':react-native-touch-id').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-touch-id/android')
    include ':react-native-gesture-handler'
    project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
    apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
    include ':@react-native-firebase_app'
    project(':@react-native-firebase_app').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/app/android')
    include ':app'

build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {
        ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
        }
        repositories {
        google()
        jcenter()
        }
        dependencies {
        classpath("com.android.tools.build:gradle:3.4.1")
        classpath 'com.google.gms:google-services:4.3.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        }
    }

    allprojects {
        repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        }
    }

在我们尝试新的克隆后项目停止工作,该项目解决了一些问题。 如果需要更多信息,请告诉我。

【问题讨论】:

  • Firebase 实例 ID (IID) 是 Firebase 的一个内部组件,可为每个应用实例生成唯一 ID。许多 Firebase SDK 正在从 IID 迁移到 Firebase 安装服务 (FIS),其用途大致相同。您可能想删除对 iid 的依赖,然后看看它是否会要求不同的 SDK 依赖。

标签: android ios reactjs firebase react-native


【解决方案1】:

尝试使用包的版本。就我而言,我在版本之前清除了向上箭头并且它有效。在我恢复更改并且一切顺利之后,请不要担心。

"@react-native-firebase/iid": "6.3.4", DOWNGRADING DID NOT HELP ( version bellow )
"@react-native-firebase/iid": "^6.3.4", DOWNGRADING DID NOT HELP ( version bellow )

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-24
    • 2019-02-19
    • 1970-01-01
    • 1970-01-01
    • 2017-09-25
    • 2018-10-23
    相关资源
    最近更新 更多