如何从 react-native 项目中取消链接库 [英] How to unlink library from react-native project

查看:29
本文介绍了如何从 react-native 项目中取消链接库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在安装后安装了这个库(https://github.com/stefalda/ReactNativeLocalization)说明

I installed this library (https://github.com/stefalda/ReactNativeLocalization) following the installation instructions

npm install react-native-localization --save
react-native link react-native-localization

我不想再使用它了.我已经尝试了以下步骤将其从我的项目中删除:

and I don't want to use it anymore. I already tried the following steps to remove it from my project:

npm unlink react-native-localization
npm uninstall react-native-localization --save

我试着跑

react-native unlink react-native-localization

但是,我收到错误消息 react-native-localization 不是 react-native 库.

However, I get the error message that react-native-localization is not a react-native library.

当我运行 react-native run-android 时,出现以下错误:

When I run react-native run-android I get the following error:

Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve project :react-native-localization.
     Required by:
         project :app
      > Unable to find a matching configuration of project :react-native-localization:
          - None of the consumable configurations have attributes.

推荐答案

首次运行

react-native unlink libraryname

然后

npm uninstall libraryname

或使用yarn

yarn remove libraryname

万一,如果它不起作用

转到您的项目 android 目录并打开 setting.gradle

Go to your project android directory and open setting.gradle

并手动删除您的库配置.和

and remove your library configration manualy. and

还要检查您的 MainActivity.java 以删除有关库的任何配置.

also check your MainActivity.java to remove any configration about library.

希望能帮到你!!!

这篇关于如何从 react-native 项目中取消链接库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆