highcharts / highcharts-react-native

Other
103 stars 81 forks source link

expo-filesystem.downloadasync is not available on android #96

Closed wzhang2 closed 4 years ago

wzhang2 commented 4 years ago

the charts show up ok on iOS, but when it gets to android, I found out that the rendering would always return an empty View cause the hcModulesReady flag is false

` render() { if (this.state.hcModulesReady) { const scriptsPath = this.state.useCDN ? httpProto.concat(cdnPath) : path; const setOptions = this.state.setOptions; ... // Create container for the chart return ( <View style={[ this.props.styles, { width: this.state.width, height: this.state.height } ]}

<WebView ref={ref => { this.webviewRef = ref }} onMessage={this.props.onMessage ? (event) => this.props.onMessage(event.nativeEvent.data) : () => { }} source={ { html: this.state.layoutHTML } } injectedJavaScript={runFirst} originWhitelist={["*"]} automaticallyAdjustContentInsets={true} allowFileAccess={true} javaScriptEnabled={true} domStorageEnabled={true} useWebKit={true} scrollEnabled={false} mixedContentMode='always' allowFileAccessFromFileURLs={true} startInLoadingState={this.props.loader} style={this.props.webviewStyles} /> ) } else { return } }`

I tried to copy the Highcharts-files and Highcharts-layout folders to android/app/src/main/assets/ and run the release build, but it still wouldn't work

I'm using a functional component instead of a HOC, and I'm using android product flavours, im not sure if any of these would make a difference, here's my rendering logic

<View> <HighchartsReactNative styles={lineChartStyles.container} options={chartOptions} /> </View>

i tried to render the examples from the doc and to no avail as well

my versions are: "react": "16.8.6" "react-native": "0.60.5" "@highcharts/highcharts-react-native": "^3.0.1" "react-native-webview": "^10.4.1" "metro-config": "^0.62.0"

node -v v12.9.1 npm -v 6.10.3

im not using expo, and i tried this on both simulators and actual devices

wzhang2 commented 4 years ago
Screenshot 2020-08-13 at 6 05 29 PM Screenshot 2020-08-13 at 5 59 16 PM
wzhang2 commented 4 years ago
Screenshot 2020-08-14 at 10 33 11 PM

im getting this exception on android only, could this be related?

wzhang2 commented 4 years ago

i tried to turn on useCDN and useSSL as well, none of the combinations works

wzhang2 commented 4 years ago

this was a library version issue with uimodules

sebastianbochan commented 4 years ago

Thank you for the feedback.

We always recommend to use the up-to-date versions (or declared in the package.json)