Could Not Load App error APK Android React Native - android

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.

Related

APK app build with react-native expo and build with expo stuck on splash screen

I have just finished my first android app using react-native v0.69.6, I have used eas to generate an APK file, which is stuck on the splash screen.
I have also created a new bar-bones project and build an APK file but the same issue.
There could be hundred of reasons why it's stuck there.
First of all make sure to read carefully all the doc: https://docs.expo.dev/versions/latest/sdk/splash-screen/
If still doesn't work, try to add Sentry to your Expo app, so you can catch some errors that may be blocking it. https://docs.expo.dev/guides/using-sentry/

React Native app crashes after installed on real device

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.

flutter apk test on my friends' android devices

I've finally completed building my own first flutter app, a lot thanks to SO. But I've still got an issue about testing my flutter apk in others' devices. So, finally i got 'app-release.apk', 'app.apk' and few more apk-related files. So excited, I sent those files to my friends, but friends told me that the app is well downloaded but not able to open it. So here's the question! Is there any additional essential commands to successfully open the apk file on real android device? If so, is there really no way to install and successfully open and use .apk or .aab flutter app in my friends' android device? I want to test my app in friends' device BEFORE google's review is done! Thank you in advance [:
Hey congratulations that you have completed the first app.
you have to run this command
flutter build apk --split-per-abi
this command gives your three apk file so you have to ask your friend that which processor he has. Depends on it you will give it.
<app dir>/build/app/outputs/apk/release/app-armeabi-v7a-release.apk
<app dir>/build/app/outputs/apk/release/app-arm64-v8a-release.apk
<app dir>/build/app/outputs/apk/release/app-x86_64-release.apk
Make sure your app is running perfectly in release mode as well
you can verify it via flutter run --release -v.
-v means verbose you can see the complete logs of your flutter app
I use VSCode so can't comment on AS. Basically though, to give your friends apks that they can side load on Android devices. In the terminal, first do a Flutter clean and when it completes execute 'flutter build apk --target-platform android-arm64'. The resultant app.apk in your outputs folder should be able to run on their devices.

How can I sign Android application with AOSP certificate

The context of my issue is the following:
I build AOSP for our hardware device on Linux
Together with the system, I build an APK as a system application
Everything works fine in this setup when I flesh it together with system image
However, I would like to have this application build separated from the AOSP build and be able to build it standalone and install from Windows.
On windows, I am trying to build it with Gradle
And the problem arises when I try to push the build to the device the following way:
adb install -r my_app.apk
adb: failed to install my_app.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package <...> signatures do not match the previously installed version; ignoring!]
Obviously the error means that I am missing a platform signature in the application, but where to take it from the AOSP build and how to sign it with Gradle build is not so clear.
Also here I found an advice to uninstall the system app first before installing. Unfortunately, for my case it does not help, the error is still the same even I uninstall it first.
I already spend quite some time on this, searching in the Android make-files for the signing script, but it seems to be not that straight forward there.
Any help would be highly appreciated...
Create a keystore from platform.x509.pem and platform.pk8 files located in build/target/product/security. Then use that with gradle.
See this answer for how to do the conversion: https://stackoverflow.com/a/22214826/3801327
Note: Don't use the default keys included with AOSP, everyone has those, and would be able to make their app a system app in your platform. Generate your own keys.

Android Build and Installation error: INSTALL_PARSE_FAILED_NOT_APK

Have these erro when i'm trying to build the apk to some devices. Have no idea whats going on.
I get that when i build and install apk on device at the first time.
Someone have some tips for that?
[[EDIT]]
Well, after creating a debug key on keystore, i can build and deploy the apk via ADP to the device. But, dont know why, the error just return...
And now, we have other error:
UPDATE:
I Fix that issue removing all Android SDK and Android Studio and ReInstall it.
The problem can be solved by addding the install flags -r -t in the Run/Debug Configuration Dialog like it's showed in the given image
You can find Run/Debug Configuration Dialog location here according to Jetbrains.
UPDATE: Depending on the Android Studio version the Run/Debug Configuration position in the IDE can be slightly different, but always refer Jetbrains to find whatever you are looking for
When you've installed an APK from another source, Android Studio warns you before overwriting.
For example, if I've developed an application, uploaded it onto the Google Play Store, downloaded it, then try to re-deploy that same application from Android Studio, I'll get this warning.
It's trying to tell you that the way the package is signed is different; it's warning you that another app might be masquerading as the original.
The reason is you are trying to install the application with the same package name.
If you have already downloaded the same application from the play store /app market, then simply uninstall that application and RE-RUN.
This error can also occur if you recently switched branch which had different build variants declared in build.gradle file and you didn't perform gradle sync.
For example you had release and debug and then you switched to branch which has releas, deubg and staging variants; your project will still build but while installing apk this error can pop up.

Categories

Resources