React Native app crashes after installed on real device - android

Just rebuilt React Native app as the previous version failed in building on Android emulator. The React Native is upgraded from 0.66 to 0.67 and a few other modules, such as React Native gesture handler, were upgraded as well.
The app works fine on Android 2021.1.1 Patch 2 emulator. However after downloading the release package from the distribution server, the app installed on Android 10 device quits as soon as launching without giving any error.
What is the problem with the release package? Here is the build steps:
./gradlew bundleRelease
bundletool build-apks to build mypackage.apks with signature.
unzip it into mypackage.apk
Connecting android device to dev Mac using USB cable, the app was launched successfully on the real device. And the app can be launched successfully late as well. I notice that the size of the app is 77MB which is about twice as big as the app installed from the universal apk.

If you need to check apk on real device, follow this build steps:
Release APK Generation.
Place your terminal directory to Android using:
cd android
Then run the following command:
For Windows:
gradlew assembleRelease
For Linux and Mac OSX:
./gradlew assembleRelease
As a result, the APK creation process is done. You can find the generated APK at android/app/build/outputs/apk/app-release.apk. This is the actual app, which you can send to your phone or upload to the Google Play Store. Congratulations, you’ve just generated a React Native Release Build APK for Android.
There are frequent errors that show up in this process sometimes, which is typical to a React Native app, given React Native is continuously evolving. We are laying out here the most frequent React Native build errors that we ran into, to save you time and headaches.

Related

Flutter: How to create a development APK that can be installed on the phone

I recently started working with flutter. I have been making several test applications. They all work well on emulators.
But now I want to be able to use them on my cell phone.
I took the APK that is generated when I run the application in the emulator, indicated in this route:
But it always fails to install
So far, my applications are simple, Hello world, Add numbers, etc.
Any ideas?
How should I do it correctly?
First: Open your Terminal/Shell/Command Line and open the directory of the Flutter App in there (cd PATH_TO_YOUR_FILE)
You probably want to create a profile-mode apk for testing. This build still helps debugging while having the speed of the --release version:
This creates a single APK which works on all devices (x64, arm64 and arm), it's probably pretty big:
flutter build apk --profile
If the people who install your App know which devices they have, you can use the split-per-abi command which creates three different APKs for all architectures (x64, arm64 and arm)
flutter build apk --profile --split-per-abi
If you want to have a release build, you can use what #Niteesh commented:
flutter build apk --release --split-per-abi
Release-builds can be uploaded to Google-Play (also the internal testing)
Read more: https://flutter.dev/docs/testing/build-modes
the apk that is generated when you run the app is the debug-apk, it contains lots of overheads which helps in flutter hot reload and hot restart. The size of debug apk version is also a lot.
use this command to generate release version of apk
flutter build apk --split-per-abi
After execution of the command, you get the path of the apk, something like this
√ Built build\app\outputs\flutter-apk\app-armeabi-v7a-release.apk (7.0MB).
Then you can install that apk on your phone

debug version of an apk got blocked by play services

I'm trying to build my app for developing purpose, It worked before but when I'm trying to build it on a new computer Google Play Protect blocks my app.
My application is build on Ionic 4, on a new computer (I develop it on another computer).
I tried to build it with debug option but it didn't work.
I did a research and found some answers, this was the most logical: Debug app blocked by play protect
I tried to delete the debug key from the ~/.android/ directory and after it didn't work I tried to delete all cache data from the ~/android/ directory.
I also saw this question installation app blocked by play protect but he had problem with release apk and not with debug apk as I have.
How am I trying to build:
ionic cordova build android --prod --debug
After it didn't work I tried to clean my configuration:
cordova clean
didn't work either.
The error message that I get is that the app developer isn't recognize to google.
Expected result is: be able to install debug application for developing purpose.

Expo: what is the difference between expo build and expo upload

What are difference between expo build and upload. Does upload cmd still return a standalone app. I realized if i run on Expo Client will work fine but when build a standalone version, the application does not behave the same again.
The commands build and upload are very different ones. The build command (Expo documentation on building) builds a standalone app, while the 'upload' command (Expo documentation on uploading) uploads the standalone app that you've built to the App Store or the Play Store (Your Choice).

React Native - build apk with plugins

I’m using react-native-push-notifications to send local notifications on my react native app. The app works perfectly on my android emulator and on any physical device while using react-native run-android. But when I signed my app and build an apk throw gradlew assemblerelease the apk builds without compiling react-native-push-notifications and the app does not send notifications. I think I should link the plugin with build.gradle but I’ve searched for a while and didn’t figure how.

Could Not Load App error APK Android React Native

So, I'm stuck with an error after generating APK with React-Native. I tried on multiple computers, 32-bit and 64-bit operating system and had no success.
How I got here
First, I created my app with
create-react-native-app suporteecontrole
Then I started developing my app, installing dependencies, and etc. After making sure that the APP was running without any errors, I ejected with the command line:
npm run eject
I've put my expo credentials and it worked without any errors too. I figured that it was going to work.
Generating APK's
To generate APK, i followed the instructions on this link:
React Native Build Signed APK
1 - I installed the JAVA 8 SDK, and all dependences too.
2 - I generated the Key by following the step one on the link.
3 - I changed all gradle files according to the link
4 - Then I runned this lines on cmd:
cd android
And
gradle assembleRelease
No errors popped up. I made it to the build successfully.
So, It generated some files: app-dev19-release.apk, app-dev-release.apk, app-devRemoteKernel-release.apk, app-prod-release.apk.
I installed app-prod-release.apk on my mobile, and returns an Expo error:
Could not load app
photo_2018-07-24_12-57-51
I searched Google for this, and found nothing.
Can anybody help me with this?
It is frustrating how the create-react-native does expo by default instead of normal react app. But you've already ejected from the expo app, and your code now wont be working on it.
Instead you'll see a new app on your phone with the name and icon you chose. Try to find the App and run it. And to assemble a release, you actually need to sign it too, so I hope you've done the signing right. Take a look at this https://facebook.github.io/react-native/docs/signed-apk-android.html for signing if you face that error.

Categories

Resources