somonus / react-native-echarts

Echarts for react-native. The react-naitve chart.
MIT License
722 stars 309 forks source link

Error:Error: The file name must end with .xml or .png #18

Open chenchongyu opened 7 years ago

chenchongyu commented 7 years ago

打release包的时候报错了。。\android\app\src\main\res\drawable-mdpi\node_modules_nativeecharts_src_components_echarts_tpl.html Error:Error: The file name must end with .xml or .png

这种问题怎么搞?

chenchongyu commented 7 years ago

问题解决了,参考了之前issues的解决办法,把tpl.html放到assets下

chenchongyu commented 7 years ago

@TrustTheBoy xxx\node_modules\native-echarts\src\components\Echarts

juiceo commented 7 years ago

Having the same problem, did you guys find a solution? If so, could you provide it for me in english? :)

juiceo commented 7 years ago

any news on this?

chenchongyu commented 7 years ago

@lappalj4 put the tpl.html(\node_modules\native-echarts\src\components\Echarts) into android/app/src/main/assets, and then modify the index.js in \node_modules\native-echarts\src\components\Echarts. Modify the src like this: source={DEV?require('./tpl.html'):(Platform.OS === 'ios')?{uri:'./tpl.html'}:{uri:'file:///android_asset/tpl.html'}}

juiceo commented 7 years ago

@chenchongyu Thanks for the reply! I am still getting a gradle build error, because react native is trying to copy the tpl.html file into android/app/src/main/res/drawable-xxxx directories:

* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> /....../android/app/src/main/res/drawable-mdpi/node_modules_nativeecharts_src_components_echarts_tpl.html: Error: The file name must end with .xml or .png

This only happens when I try to run react-native run-android --configuration Release