highcharts/highcharts-react-native

Error expo without expo and no charts

angeliqueIcono opened this issue · 29 comments

I try to use this wrapper without expo and I have a warning : "Error: The method or property expo-file-system.downloadAsync is not available on ios, are you sure you've linked all the native dependencies properly?"
And there is no charts displayed, I don't know if it's linked... Can I use this wrapper without expo?

Hi @angeliqueIcono ,

Thank you for your report.
Could you tell me which version of the wrapper are you running?

Kind regards!

I have the latest version : 3.0.1

Thank you for details, thankfully we found a reason of problem (old packages in the package.json). The new release will be available tomorrow.

I apologize for inconvenience.

@sebastianbochan I think a package.json update is not enough for this case. For my own upgrading, this error comes from a bare rn project. We need to install react-native-unimodules which requires manual project setting updating.

Can I use this package without expo?

Im still testing the package.json and app. I will let you know, as soon as possible, about results.

We were able to reproduce the problem in the native React Native.

"Error: The method or property expo-file-system.downloadAsync is not available on ios, are you sure you've linked all the native dependencies properly?"

Just working on solution of the problem.

Hi @angeliqueIcono , @fattomhk

We've just released the new version of the package. Would you be able to check whether the problem still exists?

Kind regards!

Yes I can check asap when you release the package!

@angeliqueIcono

Actually, it's already available on NPM, so you can simply install it.

Yes I installed it and I have the version 3.1.1 but I still have the warning and no chart displayed...
Capture d’écran 2020-08-18 à 14 54 32

@angeliqueIcono ,

I generated the new application project using create-react-native-app, installed the react-native-webview, and @highcharts/highcharts-react-native packages, added that configuration into metro.config.js, and the chart appeared on ios and android without any errors.

It's a bit hard to guess what is happening there, so could you provide us with a minimized application where the problem is noticeable? Would be very convenient to get some repository and steps to recreate the issue.

Kind regards!

You can't create the project with create-react-native-app, it's creating the project with expo, you need to create it with npx react-native init AwesomeProject. And if so you have the error.
https://reactnative.dev/docs/environment-setup on the "React Native CLI Quickstart" tab
image

Which version of EXPO CLI do you have?

Could you paste your package.json?

Have you tried to use expo init instead of react-native init ?

I don't want to use expo in my project... And you tell this in your doc : "You can either install this wrapper within app based on Expo tools, or bare React Native app."

@angeliqueIcono ,

Thank you for explanation. It definitely does the job here.
I've tested the wrapper with app generated by npx react-native init [app_name], and you're right, the problem still exists.
Happily, we do know how to resolve it.

Here are the steps I did when creating the app, in order to make it work correctly:

  • run npx react-native init myApp
  • edited the metro.config.js file, in the way mentioned above (https://github.com/highcharts/highcharts-react-native#installing)
  • installed react-native-webview library
  • installed react-native-unimodules package
  • edit two files from ios directory, as it is described here, and for android files here
  • run npx pod-install from the root directory of the app.

After doing above steps, the app should work well.
I've also added those info into the documentation and will release the new version, only to let the other users know how to correctly configure bare react native app, in order to make it run.

Please follow the steps described above and let us know about the result.
It will be very valuable to us.

Kind regards!

Yes it's working! Thanks a lot!

Kind regards!

I'm still having this error even updating to the latest version 😞
By the way, the project I'm working on is not using expo

image

Hi @iuricernov ,

Are you sure that you've followed all the steps from the #91 (comment)? It looks like the react-native-unimodules is not configured in a correct way.
Are you able to provide us with the minimal reproduced package which shows the problem?

Kind regards!

@Denyllon I'm not using expo, and unimodules looks like an expo lib. Is that really correct?
Anyway I'll give it a try today at night

As it is written in our documentation, you do not need to install a whole Expo library, but the react-native-unimodules (which are a group of foundational Expo tools) are required to make this package work correctly, and it should be installed within your bare React Native project.
Please install the package, configure the files as here, and here, then let us know if something will go wrong.

@Denyllon
Is there any chance for working without unimodules? or excluding unnecessary tools?

The unimodules are containing lots of unnecessary tools for bare react-native project.

image

Seems that this project is using Asset and FileSystem only.

@fattomhk For now, the project imports only the mentioned Asset, and FileSystem modules, so these two modules are required. We have not tried to use only the unimodules-file-system-interface and expo-asset packages, because unfortunately, we do not know too much about dependencies between packages inside the react-native-unimodules though, and their documentation recommends to use a whole package, so it's a bit much safer to use a whole package.

@Denyllon I found that the package is providing a way to exclude packages.

https://docs.expo.io/bare/installing-unimodules/

image

Could you provide a list in readme for that?

@fattomhk You're right. Thank you for the valuable remark. We'll test it, and add the info about that fact into our documentation soon. I pin the enhancement label here.

@Denyllon I am still facing this issue after trying the updated steps shared for React CLI. Also, there was no issue with unimodules lib installation but some warning messages.Can you please check?

image

image

@mahipatsinghtellius Could you provide me with the link to the minimal project (GitHub repository recommended), where the problem is noticeable during building the app? That would be the easiest way to find out what is happening there.

@Denyllon I love you ❤️, I hope you keep continuing maintenance this project.

And here is an example for anyone who needs it: https://github.com/hungdev/react-native-scatter-3d-example

Thanks @hungdev your example helped me to fix my problem