App in production crashes immediately after showing splash screen (Android only) - react-native

Yesterday I release my app but I have problem on Android. When the app starts it shows the splash screen and crashes immediately (before actually showing any part of the app) with the message “Unfortunately App has stopped”. I build the release with the following
./gradlew assembleRelease
and everything was successful. I tested the app with
react-native run-android —variant=release
on my device and there wasn’t any problem. But in production it’s not working… What can be the problem?

Actually It turns out that the problem was with managing my production releases in the Google Play Store. My first release was build from the Android Studio and not from the console with ./gradlew assembleRelease (I thought that this is just another way and did it in the standard way of building release for android app). Because of that all the JavaScript needed to run my app wasn't bundled in the APK and it was showing only the splash screen. After fixing that and releasing the new APK with the bundled JavaScript and fixing the right release on the Google Play Console everything is fine now.
The documentation is very good and clear: Releasing on Android documentation

Related

Where can I source help for native crashes of an expo EAS apk build

I am building an app using react-native on Expo and making sure to build with EAS every few days or whenever I add a new dependency.
After every build, I install the apk on an Android device and run the ios build on a simulator.
On my latest build, the build completes successfully but after installing the apk on android 10, the app opens and crashes once I navigate to a certain page.
It works fine on 3 other android phones.
The code difference between the last successful build that doesn't crash to the current one is minimal however very necessary for the app.
How can I see logs from the native crash in order to find the cause of the problem and hopefully find a fix?
I tried to install sentry but at the bottom of the page, it explains it only follows js issues and is not native.
Any ideas will be helpful
Thanks

Expo project android emulator issue

I've been working on a react-native app managed mode built on expo, I was working from a mac at first which worked perfectly fine using the IOS simulator it didn't work on android emulator on mac, here i switched to a windows computer and the issue still exists on the android emulator, executing the command "expo start" the app crashes after the splash screen before the logo appears, I tested the app on a real device on the debug mode and it worked! also after deploying the apk file the app works with no issues, the only problem is it's not working on android simulator using expo client, things i tried to solve the issue including trying to reinstall android studio and install the latest version, tried updating expo sdk to latest version also tried playing around with the app.js from where the app launches the first time but still crashes at the same point, it's not showing any errors or warning it just crashes, any suggestion or something i could try would be very helpful thanks.
I am also having a similar issue : after upgrading to the latest release (SDK 41) the android simulator hangs often and the app crash without any errors. But works some time .

React Native Release Signed APK crash on app start time

I have an issue with react native release APK.
The app run on debug mode but it crash immediately on release mode
Is that app running without any warnings/errors before building the APK?
The error message clearly says that it can't find a variable, maybe it got deleted or modified.
You can cross-check the app once by going to the development mode and see if you get the same error.
Try out clean your gradle and make the apk again.

React-Native Expo Built App Doesn't Get the Latest Javascript

Ok, I have a problem with expo build. Please let me know if you need more details. Basically, the project I am working on is NOT detached. It is just using Expo.
So I publish it. Let's say the javascript bundle version is 0.17, and I am publishing a breaking change to 0.18.
When I load the app from Hockey App, the javascript bundle is clearly not 0.18 because I don't see my breaking changes. Then, I close the app and re-open it, and the JS bundle is updated.
The build script is:
exp build:android
[exp] Android:
[exp] APK: [AWS LINK] apk has been generated, it took 0 seconds
Then, I get an AWS link to the APK, which I download and upload to Hockey Apps.
How should I diagnose this problem?
Exp version is 44.0.0
It is the way it works in Android. First time you open your app after you publish, the code is downloaded in background. Next time it will run the new code.
Quoting the documentation:
Updates are handled differently on iOS and Android. On Android, updates are downloaded in the background. This means that the first time a user opens your app after an update they will get the old version while the new version is downloaded in the background. The second time they open the app they’ll get the new version. On iOS, updates are downloaded synchronously, so users will get the new version the first time they open your app after an update.

IOS emulator app stay in background

I have a problem when running react-native run-ios on my project.
The IOS emulator launch well.
Then the application start (react-native white splash screen) and immediately after that, it return me to the Iphone home screen.
If I Cmd-Shift-H (with pressing H two times) I saw the app in the background (still with the react-native white splash screen).
When I click on it, it return me to the home screen again.
If I launch the Xcode project and run the app, it work fine and I can navigate in my application.
I've had some troubles with my app before, the IOS version was 'abandoned' and I've installed a lot of modules and changed the name of the project in the mean time, before trying to make it work on IOS.
Then I've decided to create a new project with react-native init myNewProject (because I couldn't figured out how to fix the IOS, something with a workspace not configured) and copy paste my old src and index.ios/android.js inside.
So now Android is still working and IOS is only working if I launch the app from Xcode.
I've tried to reset the emulator but it don't change anything.
I don't have any logs about app crash or something.
The Android app version is working fine.
Any idea ?
Logs
I've put the device logs after running react-native run-ios on a gist
https://gist.github.com/ansmonjol/f6fa1e71a20b944bf67429c57d081165
Additional Information
React Native version: 0.35
Platform: IOS
Operating System: macOS El capitan
Xcode: Version 8.0
I ran into this problem, and solve it:
In my case i install third-party native component in my project and link it using command react-native link <component-name>. Than i have a problem about you wrote:
Running project by Xcode - works fine. Bundling start, after loading dependency graph.
But runnig project by react-native run-ios app hide immediately and bundling not started after loading dependency graph. And not any errors happened.
I tried reinstall all, clean npm cache, react-native upgrade, delete build folder, delete derived data... nothing helped.
I found one way that helped me:
I remove that problem library not manyally from Xcode, but from terminal using command react-native unlink <component-name>. Its way to resolve this problem for me, maybe for you too.
Sorry for my english.