Not going to release apk after expo eject - react-native

I created a new project at Expo, after which I was already building it using expo buildbut over time I needed to move away from Expo a little and execute an expo eject, and then continue development on regular React Native.
I ran into the following situation: I am trying to build an apk file with the ./gradlew assembleRelease command, but I get a debug build instead of release, I don’t understand why this is happening, I tried to follow the build instructions specifically for the release version - unsuccessfully.
I also tried to create a new project without using Expo - the whole scenario described above worked correctly and I got a release build of my application, and with all that, I compared the android/app/build.gradle files in these two projects and they are almost identical in terms of their configuration.
My main task and problem is to build the release version of the apk file and understand why, with different attempts to build, I only get the debug apk.

Related

Why does my Expo app run in Expo Go but not as a development build?

I've created a development build of an Expo app using EAS. Previously I would open the app in Expo Go by running npx expo start and scanning the Metro Bundler QR code.
Now, when I try to do the same thing, Expo Go asks whether I want to open the project in Expo Go or as a "Development Build". It works fine in Expo Go, but crashes immediately when I attempt to open the dev build. The error reads:
null is not an object (evaluating '_ReanimatedModule.default.createNode')
This error is suspiciously similar to one that I encountered earlier in development, which I resolved by downgrading to React Native version 0.69.6. I'm also encountering a second error that says "'main' has not been registered", but I suspect this is downstream of the first error.
I have the same issue when I try to run the app with npx expo start --dev-client.
Any ideas why I might be having this problem?
It sounds like you may have run expo prebuild (https://docs.expo.dev/workflow/prebuild/) which removes "main": "node_modules/expo/AppEntry.js", from app.json. Try to create a new expo app and look at it's app.json file.
When you run expo prebuild it changes a few things with your project (see "side effects" in the prebuild docs).
I'm actually working through some issues with that right now too. I thought I had to run prebuild but turns out I didn't have to. Ever since I ran it my app will not load via the dev-client way. I can however switch back to npx expo start (NOT npx expo start --dev-client, see the scripts section of app.json as that is also changed when prebuild is run).
Let me know if you are able to get your app to load after re-adding the main stuff to app.json.
Ps, are you by chance using react-native-google-mobile-ads?

Impossible to update expo project inside Expo Go after switching to EAS Build

I have the need to run a project from Expo Go without being connected to PC. We are developing an app that require GPS and needs to be tested in open field.
Before EAS became the standard to create projects i used
expo build:android
ad this created not only the apk, but uploaded the project to my account and i was able to start it from Expo Go projects section just like the app was installed on phisical device. That worked also fo iOS and was a great testing feature.
After i moved to EAS Build
eas build -p android --profile preview --clear-cache
my project inside Expo Go does not update anymore and its stucked at sdk 44 even if now i'm working (and creating builds) with sdk 46.
I went through the official documentation many times but i don't get how to make the app start from Expo Go (project sction) as i did before. Maybe i'm missing some configuration.
Thank you all for any kind reply.
Have a good day.
EDIT
I found the solution to this problem and now my builds are working and uploading to Expo Go.
Check out this information: https://github.com/expo/fyi/blob/main/eas-build-archive.md
Basically EAS Updates will not bundle anything inside your .gitignore, in my case it needed specific config files. Did a quick test by taking them off the .gitignore and now it's working. Will move to GitHub SECRETS in the future.
Hope that helps.

build archive fails but build from react-native run-ios works

my react-native project builds and run from npx react-native run-ios and also it runs from xcode. now i am almost done with what i want to do and wanted to publish a version for test flight on app store but i cant archive the product which is how i used to do before. it fails right away with some swift error. in this work i added a dummy swift file and xcode also added bridge file as part of it. here is the error i get:
Been there,
make sure all the three pod, project and target have the same IOS Deployment Target.

React Native FCM not working

I am using this package https://github.com/evollu/react-native-fcm
I complete the installation process. The project is working. But every time I turn it on project. I am working ./gradlew clean on console. Other than that, I get the following error when I run
You can delete build folder, and recompile project again.

In react-native, run minified code with debugging

I have an odd issue where I get the desired behavior when running a dev build but not a release one. I want to debug the code, but as far as I know I can't do that when running --configuration Release. I want to check if the issue has to do with minifying the js or something else. Is there a way to run
react-native run-ios --minify
or something? (The above command doesn't work. error: unknown option '--minify')
I've seen that you can run react-native bundle --minify, but I don't know how to then get the bundle onto the iOS Simulator, nor if bundle is the correct way to do things in React Native v0.42, as all the bundle solutions I've seen online have been v0.15ish.