6

I'm testing out react native and can run the dev server fine on an emulator. When I go to build the apk to test on a real device, I get an

Application not installed error

System

  • My Device is Android 5.1.1
  • Emulator is Android 4.4
  • React Native 16

Steps to build apk

  1. keytool -genkey -v -keystore my-app-key.keystore -alias my-app-alias -keyalg RSA -keysize 2048 -validity 10000
  2. react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
  3. cd android && ./gradlew assembleRelease
  4. Got apk app-release-unsigned.apk

Is there anything I am missing and is the generated file supposed to be unsigned.apk ?

6
  • do you already have a debug version installed? Commented Jun 21, 2017 at 10:51
  • No, the debug version is not installed on the device... Commented Jun 21, 2017 at 10:53
  • try installing the APK using ADB. ADB should tell you the reason why the app is not is=nstalled Commented Jun 21, 2017 at 10:55
  • @VladMatvienko is the apk file supposed to be named app-release-unsigned.apk if it built correctly? Commented Jun 21, 2017 at 13:36
  • Did you set up signing in android/app/build.gradle? Commented Jun 21, 2017 at 14:36

5 Answers 5

4

This happens due to your app already install for other users so It is not visible in the app drawer. So required to uninstall your for all user and reinstall the app.

  1. Go to Device/Android OS Settings
  2. Select APPS
  3. Your app will be listed here
  4. Goto details of your app by Selecting your app from list
  5. Tap in tree dot menu at top right corner
  6. Press uninstall for all users
  7. Try again to install your app
  8. Now It will install successfully.
Sign up to request clarification or add additional context in comments.

3 Comments

One way of completely uninstall the app is running cd android && gradlew uninstallAll && cd ... When I uninstall the app in a Xiaomi Phone it doesn't completely uninstall and I have to run that command.
the ./gradlew uninstallAll command solved it for me
Are there other reasons that can lead to this problem?
3

For me, the same problem was from insufficient storage space. Maybe it'll help you.

1 Comment

works for me but before need disable google protected.
1

I have solved the issue by just uninstalling the older app by on my device. Seems I had build.apk before releasing my app. So, you cannot build.apk and release.apk of the same app simultaneously.

Comments

0

The app was previously installed, after removing that instance the issue gets resolved.

Comments

0

I got the same issue in my Redmi mobile phone. It was due to insufficient storage space. Delete some of your videos, images, or apps.

1 Comment

This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.