@wodin No I’m not using it.
I tried what you suggested npx expo start --no-dev --minify.
The app is not crashing here, so I’m unable to debug it.
This is what is leading my app to crash:
@tatianao OK then there’s more than one issue in this thread.
Expo Go includes the native code for react-native-svg version 13.4.x included in it for Expo SDK 47 apps. So if you try to run the JavaScript code from version 13.6.x, it might have problems. That probably explains your first screenshot.
So you should install the correct version (e.g. using expo-cli doctor --fix-dependencies).
I don’t see anything obviously wrong with your code, but how are you calling GroupCreateFlowCard? Maybe you’re sometimes giving it an invalid colour or something?
I’ve just created a new Expo SDK 47 app, installed react-native-svg with:
@wodin Thanks again. Would you mind elaborating a bit on this? Sry but I feel kind of new with expo right now after 2 years without working with react-native.
When running my app using expo run:android it works well in dev env. And you are right Expo Go is giving the error. So I used the command you provided to build for dev: eas build -p android --profile development. And download the APK on my machine. The command actually proposes to install the APK on the emulator directly. What I approved. But when it crashes showing
Unable to load script. Make sure you're either running Meteor (run 'npx react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.
In your answer you stated:
How to use the development build in this case? I thought the APK would be like every APK that can just be installed on a phone or device without anything else and get it working. Am I missing something?
My aim here is to share the APK with other team members so they can test the app.
I also ran npx expo start --no-dev --minify
When I scan the picture, it shows me a page where I can choose between dev build and expo. Only the expo link is working the dev build button does nothing.
Unless you are writing your own native code, I recommend not running npx expo prebuild or npx expo run:android (which runs prebuild too) because it generates the native projects which then complicates things. See Should I exclude `ios`? - #4 by wodin
tl;dr delete your ios and android directories and avoid expo run/expo prebuild
What happens if you install the one I built? (dev build)
Maybe try switching your app back to the managed workflow and rebuilding the dev client.
Yes, that’s how it should work. You can either run npx expo start and press a, or just open the app on your emulator/device and then point it at your development server by scanning the QR code or typing in the URL etc.
If the other team members are also developing the app then they can use the dev build. If they are using the app like a normal user in order to find bugs etc., but not actually developing the app, then you probably want to give them a “preview” build instead. This is built like the production version, but for “internal distribution”, so you don’t first need to upload it to Google Play/App Store.
hmmm… that should work. Alternatively you can log in to the dev build and press the “Fetch development servers” button and it should hopefully pop up there. Otherwise manually enter the URL printed under the QR code. e.g. “exp://192.168.6.7:19000”
Anyway, maybe try getting rid of the android directory and rebuilding the dev client. Then install it on your emulator/phone and open it. Then run npx expo start and try to load that in the dev client. If that works, create a “preview” build and install that and open it.
Thanks for the hint, I just remove the ios/android folder.
It was crashing immediately with the previous error.
The build work just fine. It installs the app on the simulator/device and it can be launched.
After removing the folders (ios/android) I created a new local build: eas build -p android --profile preview --local I uploaded the APK on my simulator and it installed the app. But when I do run npx expo start when pressing a it loads for sometimes and then shows the following:
When I press on Development Build it runs the app normally. But on the console, nothing is printed. Maybe npx expo start is missing something like a --debug flag? npx expo start --no-dev --minify did not help here. And npx expo start --dev-client directly ran the app on the emulator. Maybe import 'expo-dev-client'; is required?
OK, I think I might not have explained things clearly
A development build can be used for development with npx expo start. Yes, you should import 'expo-dev-client'; at the top of the main file of your app (e.g. App.js).
A preview build is like a production app which cannot connect to a development server. It can be used for QA purposes by people who are not developing the app.
So try building with eas build -p android --profile development --local and install that.
Then try npx expo start.
Yes, that is just useful if your app works in development mode, but the production app crashes. Those flags make the development build more like a production build and hopefully it will also crash and give you more information about the crash.
@wodin Thanks a lot for your explanations. I get it now.
One last question related to this one what did the author mean with
Use IP address instead of local host.
I have this same issue my server looks like this: https://<domain>:port and fetch request are failing on android with Network request failed. Everything is fine on ios. This did not help. Ex.
@wodin I was able to get react-native-gifted-charts with expo SDK 47 and react-native-svg 13.4.0 by only adding the following to my package.json
"resolutions": {
"react-native-svg": "13.4.0"
}
Since this is only 2 minor versions below what react-native-gifted-charts wants it should make using the library mostly fine with no issues for the majority of use cases. I was able to npx expo install... and expo start with no issues
Yes, that will probably work. Of course it depends on exactly why react-native-gifted-charts decided to depend on react-native-svg version 13.6.x. It could be they found some bug when using earlier versions, in which case you could run into that bug at some point. It could also be that that was just the latest version at the time the Gifted Charts project was releasing the latest version, so maybe things will work fine with the slightly older version.
My theory is that it might be slightly safer to stick with react-native-svg version 13.6.x, since that’s what Gifted Charts says it wants, and it should in theory be backwards compatible with 13.4.x. Also, since you need to build with EAS Build anyway you won’t need to ensure you’re using exactly the right version to make sure it’s compatible with the native code compiled into Expo Go. The downside of using 13.6.x is that you’ll get expo-cli doctor warnings in your build logs with Expo SDK 47.
The best I could get from the log is: ReactNativeJS: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
…and after rebuild: (same as this) Network request failed at <PATH>/node_modules/whatwg-fetch/dist/fetch.umd.js:535:30 in setTimeout$argument_0
hmmm… OK, so it looks like some sort of SSL certificate verification error. I don’t know why it would work on iOS in that case. Are you connecting to a real web server with proper SSL config? Or is this a development server of some kind?
If it’s a real, public web server, try testing the SSL setup using:
OK. Looking at the error message again, it looks like the phone/emulator doesn’t trust the root certificate or there’s a missing intermediate certificate. See Common problems verifying server certificates
Can you check the “Certification Paths” section of the SSL Server Test results? In particular the “Android” tab. e.g.:
Hey, I’m developing something with Expo, using react-native gifted charts. It used to work before, but it no longer works with expo sdk 47? That’s unfortunate.
I have a few questions: If I use the EAS build, will I still be able to make changes and run the app on my phone as usual? Will it also affect other types of libraries like react-navigation? Also will there be any costs or anything? I’m just trying to make sure.
It should work. It’s just that react-native-gifted-charts specifies a version of react-native-svg of 13.x.y where x >= 6, while npx expo install react-native-svg will install version 13.4.0. There are a couple of ways of dealing with this:
Yes, except if by “as usual” you are referring to Expo Go. You can definitely do something like that, but you will have to create a development build to use instead of Expo Go.
I’m not 100% sure what you’re asking. But basically if you create a dev build and then want to install react-navigation you’ll need to create a new dev build.
There’s a free tier. So e.g. if you’re creating fewer than 30 builds a month in total (or 15 iOS builds) and only one at a time, then you don’t have to pay for that. If you’re using EAS Update it depends on how many updaters there are per month.
You can also build on your own machine and it would be possible to implement your own update server, in which case you wouldn’t have to pay Expo anything.