2019-02-22 react-native echarts android 打包 不显示

https://blog.csdn.net/fivestar2009/article/details/83750062

今天对echarts进行打包,遇到几个问题

1)怎么打包apk,都是unsingle模式,而且安装失败 原因是

buildTypes 中没有加signingConfig signingConfigs.release

2)安装后居然echarts不显示,但是在模拟器中是显示的,也是从网上找的

2.1)复制文件tpl.html(路径: node_modules\native-echarts\src\components\Echarts)至android\app\src\main\assets目录下

有时候main下如果没有assets文件夹,则需要自己建一个

2.2)修改 node_modules/native-echarts/src/components/Echarts/index.js文件

第二行改成

import { WebView, View, StyleSheet,Platform } from 'react-native';
第25行改成

source={Platform.OS==='ios' ? require('./tpl.html'):{uri:'file:///android_asset/tpl.html'}}
其实就是把source={require('./tpl.html')} 改成上面的,需要加Platform


作者:fivestar2009
来源:CSDN
原文:https://blog.csdn.net/fivestar2009/article/details/83750062
版权声明:本文为博主原创文章,转载请附上博文链接!

你可能感兴趣的:(2019-02-22 react-native echarts android 打包 不显示)