Android 模块React本机生成失败React本机fs和rn fetch blob
当我运行npm run Android时,我在macOS for Android上遇到构建失败,我遇到以下构建失败:Android 模块React本机生成失败React本机fs和rn fetch blob,android,react-native,Android,React Native,当我运行npm run Android时,我在macOS for Android上遇到构建失败,我遇到以下构建失败: FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > Could not resolve all task dependencies for co
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve project :react-native-fs.
Required by:
project :app
> Unable to find a matching configuration of project :react-native-fs: None of the consumable configurations have attributes.
> Could not resolve project :rn-fetch-blob.
Required by:
project :app
> Unable to find a matching configuration of project :rn-fetch-blob: None of the consumable configurations have attributes.
显然,在node_modules/react native fs/android和node_modules/rn fetch blob/android中,我只看到一个IML文件,没有模块特定的代码。我忘记正确下载了吗?我的android/settings.gradle文件如下:
rootProject.name = 'FooApp'
include ':react-native-version-number'
project(':react-native-version-number').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-number/android')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
include ':rn-fetch-blob'
project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/rn-fetch-blob/android')
include ':react-native-google-signin'
project(':react-native-google-signin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-signin/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':app'
我是否遗漏了一些明显的内容?您可以尝试删除文件夹节点模块,然后重新安装
rm -rf node_modules
npm install
react-native link
在那之后,用cd清理android&&gradle清理
然后再次运行android您可以尝试删除文件夹节点模块并重新安装
rm -rf node_modules
npm install
react-native link
在那之后,用cd清理android&&gradle清理
然后再次运行android我想只要运行命令就行了
rm -rf node_modules && npm install
在运行之后,再次运行本地运行android可以解决问题,我认为只需运行命令即可
rm -rf node_modules && npm install
而在运行之后,本机运行的android再次能够解决这个问题