Hi @GillesN ,
Thanks for writing into Amplitude Community! All Starters now write in here and it is great to see it being used more! :D
I understand you are having issues with the React Native SDK library from Amplitude. Can you make sure you do not have any VPNs or Active? Can you ensure there is no 3rd party interference with the internet connection too. I have come across this before and as someone posted, it is often helps to re-install the application using react-native run-android
after npm install @amplitude/react-native@latest.
Can you check if that helps? If not, can you remove the React-Native SDK and try to reinstall it again and see if that helps?
I hope this helps for now! I look forward to your reply so we can proceed!
Kind Regards,
Denis
Hello @Denis,
Thanks for your answer.
There is no active VPN. Not really sure what you mean with third party interference but as far as I know, there is not. I reinstalled @amplitude/react-native
and react-native
but the error remains.
Thanks,
Gilles
To close the loop here, this was an issue with Expo.
We do know Expo can cause issues with this. So first of all, using Expo inherently imposes limits on what type of react-native libraries you can use. Checkout: Using libraries - Expo Documentation
Now check the following:
Does it include an ios and/or android directory? (our library does)
Does the README mention linking?
Is it built specifically for Node.js, the web, electron, or another platform?
If you answered yes to either of these questions and the library is not part of the Expo SDK, this library may not be supported in the managed workflow! Run expo init and add the library to the new project and try to use it. This is a great way to experiment with a library before including it in your project in all circumstances.
If the library is not compatible with the managed workflow and you need it to build your app, you may want to eject to the bare workflow. We do not support Expo because of the restraints listed above. You can either eject from expo or use the react-native-cli.
To create an app from react-native-cli:
npx react-native init AwesomeProject
More details here: Setting up the development environment · React Native
Here Using libraries - Expo Documentation , you will see that libraries with ios/android folders are rarely supported by expo’s Managed workflow. We built this library for react-native-cli users.
Expo does have their own module for Amplitude: Amplitude - Expo Documentation
Bottom line, official sdk is not usable in expo.