react-native应用程序中的canOverrideExistingModule问题 [英] canOverrideExistingModule issue in react-native application

查看:582
本文介绍了react-native应用程序中的canOverrideExistingModule问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我尝试用react-native-camera模块创建一个相机应用程序 当我尝试在我的设备(Android移动版)上运行此应用时,出现以下错误.有人可以为此提供解决方案吗?

Hello every one i tried to create an camera app with react-native-camera module when i tried to run this app on my device (android mobile) getting following error. Can any one please provide me solution for this ?

推荐答案

转到文件"MainApplication.java"(在.\ android \ app \ src \ main \ java \ com \ projectName下)

Go to file "MainApplication.java" (under .\android\app\src\main\java\com\projectName)

确保在getPackages()函数下您没有重复的行(在我的情况下,我有两次"new RCTCameraPackage()").

Make sure that under getPackages() function you don't have duplicate lines (in my case I had "new RCTCameraPackage()" twice).

也修复重复的导入.

这篇关于react-native应用程序中的canOverrideExistingModule问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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