"-6ren"> "-我正在使用 react-native-webview-file-upload-android 但我想用 react-native-webview-android 替换它。 我运行了以下命令: npm -6ren">
gpt4 book ai didi

android - 将一个组件替换为另一个组件,构建失败并出现错误 "Could not resolve project "

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

我正在使用 react-native-webview-file-upload-android 但我想用 react-native-webview-android 替换它。

我运行了以下命令:

npm uninstall react-native-webview-file-upload-android
npm install --save react-native-webview-android
npm link react-native-webview-android

并且我从

更改了 app.js 中的导入
import AndroidWebView from 'react-native-webview-file-upload-android';

import WebViewAndroid from 'react-native-webview-android';

现在当我尝试 npm run 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 configuration ':app:debugCompileClasspath'.
> Could not resolve project :react-native-webview-file-upload-android.
Required by:
project :app
> Unable to find a matching configuration of project :react-native-webview-file-upload-android: None of the consumable configurations have attributes.

我试过了 npm start --clear-cache , cd android && gradlew clean , npm unlink react-native-webview-file-upload-android

但是都没有用,为什么老包这里还是报错?

最佳答案

我找到了解决方案,在我的 android/app/build.gradleMainApplication.java 中,旧包仍在导入所以我删除了导入行和成功了

关于android - 将一个组件替换为另一个组件,构建失败并出现错误 "Could not resolve project <old component name>",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54065359/

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