react-native-fusioncharts icon indicating copy to clipboard operation
react-native-fusioncharts copied to clipboard

fusioncharts not working in expo for Android

Open MaximMalyavko85 opened this issue 5 years ago • 3 comments

Hello team. I two day looked answer for my situation, but not found. FusionCharts good work for ios, but for android not display: showed error Encountered an error loading page, Object { "canGoBack": false, "canGoForward": false, "code": -1, "description": "net::ERR_FILE_NOT_FOUND", "loading": false, "target": 303, "title": "", "url": "file:///android_asset/FusionCharts.html", } I understend, what expo does not find file FusionCharts.html, but why? I followed instruction in many resources:

  1. in android/app/src/main/assets i have file FusionCharts.html.
  2. "clean:build:android": "rm -rf android/app/build", "prod:android": "npm run clean:build:android && react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res",

npm run build:assets // first time i haved error - > index.js not defined. I created index.js in root directiry and write text

import { AppRegistry } from 'react-native'; import App from './App'; AppRegistry.registerComponent('MILK PRICE INDEX RDRC', () => App);

after this npm run build:assets is done

In my charts component i have this line: this.libraryPath = Platform.select({ android: { uri: 'file:///android_asset/FusionCharts.html'}, ios: require('../assets/FusionCharts.html') });

<FusionCharts ...... libraryPath={this.libraryPath} />

but i get error Encountered an error loading page. sdk 35

Thanks for yours answers.

MaximMalyavko85 avatar May 22 '20 11:05 MaximMalyavko85

Hello team. I two day looked answer for my situation, but not found. FusionCharts good work for ios, but for android not display: showed error Encountered an error loading page, Object { "canGoBack": false, "canGoForward": false, "code": -1, "description": "net::ERR_FILE_NOT_FOUND", "loading": false, "target": 303, "title": "", "url": "file:///android_asset/FusionCharts.html", } I understend, what expo does not find file FusionCharts.html, but why? I followed instruction in many resources:

  1. in android/app/src/main/assets i have file FusionCharts.html.
  2. "clean:build:android": "rm -rf android/app/build", "prod:android": "npm run clean:build:android && react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res",

npm run build:assets // first time i haved error - > index.js not defined. I created index.js in root directiry and write text

import { AppRegistry } from 'react-native'; import App from './App'; AppRegistry.registerComponent('MILK PRICE INDEX RDRC', () => App);

after this npm run build:assets is done

In my charts component i have this line: this.libraryPath = Platform.select({ android: { uri: 'file:///android_asset/FusionCharts.html'}, ios: require('../assets/FusionCharts.html') });

<FusionCharts ...... libraryPath={this.libraryPath} />

but i get error Encountered an error loading page. sdk 35

Thanks for yours answers.

Facing the same issue

mdshadman avatar Jun 15 '20 13:06 mdshadman

I got the same issue in expo: 40.0.0 react-native-webview: 11.2.3 react-native-fusioncharts: 4.1.2

Encountered an error loading page, Object { "canGoBack": false, "canGoForward": false, "code": -1, "description": "net::ERR_FILE_NOT_FOUND", "loading": false, "target": 17, "title": "", "url": "file:///android_asset/fusioncharts.html", }

imamrmdn avatar Feb 22 '21 10:02 imamrmdn

@MaximMalyavko85 did you get it to work on Physical Iphone devices if yes is it an expo manage or an expo bare app, I am having a difficulty making it to work on a physical Iphone device. it works fine on an emulator but it is not working on Iphone.

adelaadeoye avatar Jun 26 '21 04:06 adelaadeoye