gpt4 book ai didi

android - React Native 找不到链接包

转载 作者:行者123 更新时间:2023-11-29 23:02:06 24 4
gpt4 key购买 nike

当尝试运行 react-native run-android 时,构建无法找到链接的包。

已经尝试更新包,一切都在最新版本上。

package.json:

"@react-native-community/async-storage": "1.5.0",
"@react-native-community/netinfo": "3.2.1",
"lodash": "4.17.11",
"react": "16.8.6",
"react-native": "0.59.10",
"react-native-actionsheet": "2.4.2",
"react-native-device-info": "2.1.3",
"react-native-gesture-handler": "1.3.0",
"react-native-image-crop-picker": "0.24.1",
"react-native-masked-text": "1.12.3",
"react-native-progress-bar-animated": "1.0.6",
"react-native-youtube": "1.1.0",
"react-navigation": "3.11.0",
"react-redux": "7.1.0",
"redux": "4.0.1",
"redux-persist": "5.10.0",
"redux-saga": "1.0.4"

在 CLI 上:包 com.facebook.react.module.annotations 不存在:导入 com.facebook.react.module.annotations.ReactModule

在 Android Studio 上:不是受支持的存储库协议(protocol)“C”:有效协议(protocol)是 [file, http, https, gcs, s3, sftp]

最佳答案

这通常发生在您的构建无法找到您的 node_modules 文件夹时。

尝试检查你的 android/build.gradle 文件,如果有任何固定路径,例如:

allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "C:/dev/myapp/node_modules/react-native/android"
}
maven { url "https://jitpack.io" }
}
}

查看行 url "C:/dev/myapp/node_modules/react-native/android"

您可能希望将固定路径更改为其相对版本:url "$rootDir/../node_modules/react-native/android"

这应该有助于构建找到正确的路径。 😄

关于android - React Native 找不到链接包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56858772/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com