android - 用另一个组件替换了一个组件,构建失败并出现错误“无法解析项目"
问题描述
我正在使用 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.gradle
andMainApplication.java
中,旧包仍在导入中,所以我删除了导入行并且它有效
推荐阅读
- sql - 我不知道如何纠正这个 sql 练习
- c# - Razor 表删除行保持ID
- kubernetes - Kubernetes VPA:targetref 选择器的问题 + 最少的资源
- javascript - WebExtensions - 获取全局窗口属性
- android - Android 双向数据绑定观察者调用两次
- android - Android BottomSheetDialogFragment 状态变化监听器
- php - 为子域创建 cookie
- r - 将线性模型应用于指定变量时使用映射
- python - 如何使用 Python 中的 Paramiko 库在 SFTP 上将 Pandas DataFrame 传输到 .csv?
- visual-studio-code - VS Code - 用于测试方法的带有空格的片段转换文本