react-native 填坑之canOverrideExistingModule=true

app在模拟器中卸载了,再重新编译,app却打开不了,直接报错:

Native module VectorIconsPackage tired to override modulename for module  name VectorIconsPackage.If this was your intention,setcanOverrideExistingModule=true

这个是Project\android\app\src\main\java\com\project\MainApplication.java里面

protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
VectorIconsPackage()
, new VectorIconsPackage()
);
}

当中VectorIconsPackage重复了,(一开始是手写进去的,可能是重新编译的时候会又自动加进去一次),删除一个就可以了。

结尾

RN全是些坑,我记录了N多bug了

猜你喜欢

转载自blog.csdn.net/mffandxx/article/details/80783549
今日推荐