react-native link some pit mining experience

最近做气象防雷app项目的时候,选用高德地图来开发;然后找到了react-native-amap3d这个第三方组件,很好用的一个地图组件,文档还比较细,GitHub上面Issuse也很活跃。

初次使用react-native开发APP还是有一些困难,这个组件是需要链接原生库的。就是说要使用react-native  link这个命令。但是链接了原生库之后,再要下载其他的第三方组件就报错打包不了APP,估计是node_modules文件里和app文件的link出什么问题了(猜的),然后我必须再次执行link命令才可以,但是再次link之后又会有新的问题就是连接原生库的方法出现问题了,此时就是要把app>src>main>java>com>"你的APP名"> MainApplication.java文件里面

protected List <ReactPackage> getPackages () {
. return Arrays, <ReactPackage> asList (
new new MainReactPackage (),
new new VectorIconsPackage (),
new new AMap3DPackage (),
new new VectorIconsPackage (),
new new AMap3DPackage ()
);
}
command you execute the function as repeat repeat to add a link command, you can manually remove excess

There settings.gradle also appear redundant, but does not seem affected, can be removed

Reproduced in: https: //www.jianshu.com/p/23bd7beb553f

Guess you like

Origin blog.csdn.net/weixin_34205076/article/details/91233623