I have created a basic app using react native. When I run the app using react-native run-android, the app runs successfully on a connected device.
Now I want to share the apk file with the client. For that I have created the apk following the steps mentioned on:
https://facebook.github.io/react-native/docs/0.51/signed-apk-android.html
When I install the app using the generated apk, the app installs successfully, but gives the following error when the app is opened the first time.
After that whenever I open the app, I get a blank screen.
Related
I just build an simple app that can login and also able to take picture using vue js. Then using capacitor i successfully create an .apk file to install it in mobile. However my app run just fine on other device but not on this one device. When i install the .apk file then run the app on the device it will not read the file from my asset where i store all logo, pic and many more for the app. The worst case is it also not opening the camera even i already include permission whatsoever. can you guys help me?
I have created a build for android in expo. I got a standalone link which helped me download an Apk link. I installed that apk in my mobile device but it is not getting connected with the backend (api). When I run metro bundler on my development machine, then the apk works perfectly, it fetches the data from api and displays it.
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.
I had developed a flutter application with Razorpay payment gateway. While I run this app in debug mode, it works fine. And hot reload also works fine. Then I generate apk using flutter build apk command, After installing this application with that apk file. While entering into the Razorpay payment gateway the app stops.
And this same case also occurs in another application also, I'd developed another app with Jitsi video connection setup. While entering the Video connection gateway stops. and of course, this also worked fine in debug and hot reload mode.
I'd found something, app stopes only when Loading com.google.android.webview in my above specified two cases.
My log shows that,
I/WebViewFactory(pId): Loading com.google.android.webview version XX.X.XXXX.XXX (code codeId)
I forgot to add proguard-rules.pro file at android/app. So only these two apps stoped while installed with apk.
For Gitsi - https://github.com/gunschu/jitsi_meet/blob/master/example/android/app/proguard-rules.pro
For Razorpay - https://github.com/razorpay/razorpay-flutter/issues/42
How do I build the react-native app so I can test it in hockeyapp without being connected?
I'm using react-native-hockeyapp and successfully built the app, which listed it on hockeyapp, but now with the hockeyapp changes:
It does not run on a connected device with run-android and I get a white screen and no console debug messages anymore.
When I uploaded the app_Debug.apk to the hockeyapp by dragging it on the website, I got an invite. Run it on my device and get the white screen and the following two errors:
a. unable to load script from assets 'index.android.bundle'. Make sure your bundle is pakcaged correctly...
It then shows a white screen.
b. If I shake and press reload it says: could not connect ot development server. I don't want to connect to development server. I want to test it disconnected!
How do I build the app? In Android Studio? Any pointer to instructions?
And how do I preserve the possibility to react-native run-android so that I can test it locally and debug quickly for development?
I created a keystore and then went to myproject/android folder and gradlew assembleRelease
See https://github.com/benloopcompany/react-native-hockeyapp/issues/84 for more details