facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.99k stars 24.31k forks source link

Failure [INSTALL_FAILED_VERSION_DOWNGRADE] on Android #29568

Closed lisichka999 closed 2 years ago

lisichka999 commented 4 years ago

Description

I am getting Failure [INSTALL_FAILED_VERSION_DOWNGRADE] error when trying to install my application on device. If I do clean install and not upgrade the installation does succeeded, but I need to release new version for upgrade.

React Native version:

61

Platform

Android

Steps To Reproduce

Not changes were made

github-actions[bot] commented 4 years ago
:warning: Using Old Version
:information_source: It looks like you are using an older version of React Native. Please upgrade to the latest version, and verify if the issue persists. If it does not, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the current release.
github-actions[bot] commented 4 years ago
:warning: Missing Environment Information
:information_source: Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.
krizzu commented 4 years ago

This is not RN issue - more like mistake when versioning your app. Here're docs about it. (tl;dr: make sure you bump versionCode in app/build.gradle when doing a release - versionCode is to determine if app is newer than previous one.).

stale[bot] commented 3 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

raikk commented 3 years ago

that's an issue that happened to me. Please check if you already have installed it and then trying to install an app of the same package name (e.g of com.rnexample).

Remove the previous app then install.

Mingyang-Li commented 2 years ago

I've been stuck on this for ages, full error log here (expires in 6 days) - https://privatebin.at/?3589145cf3630d25#CEFYUMchDLVVJy1zFhPutVuCjz7mMMqTTLoFh8f5e93k

Methods tried but didn't resolve my issue

  1. Restart PC
  2. Ran cd android then gradlew clean / gradlew cleanBuildCache
  3. Re-installed node modules
  4. Cleaned android build cache
  5. Deleted /app/.gradle folder and re-generated
  6. Deleted /app/build folder and re-generated
  7. Reinstalled android studio
  8. Re-cloned repo
  9. Changed android build version from 30 to 31
  10. Removed react-native-cli from global using npm uninstall react-native-cli -g
  11. Wiped all my emulators data
  12. Added more memory to android virtual device
  13. Reinstalled yarn

I didn't make any changes to the repo or local dev env, build fails simply began on a random day I started working...

It's driving me nuts, any direction / advice would be appreciated

cortinico commented 2 years ago

Closing as it's a stale issue + the INSTALL_FAILED_VERSION_DOWNGRADE is an Android problem and is unrelated to React Native per se.

The first answer on stackoverflow explains why this is happening: https://stackoverflow.com/questions/13808599/android-emulator-installation-error-install-failed-version-downgrade

LuizFBrisighello commented 1 year ago

that's an issue that happened to me. Please check if you already have installed it and then trying to install an app of the same package name (e.g of com.rnexample).

Remove the previous app then install.

Thanks! I had a product flavor using the same applicationId

gersonmontenegro commented 1 year ago

I've been stuck on this for ages, full error log here (expires in 6 days) - https://privatebin.at/?3589145cf3630d25#CEFYUMchDLVVJy1zFhPutVuCjz7mMMqTTLoFh8f5e93k

Methods tried but didn't resolve my issue

  1. Restart PC
  2. Ran cd android then gradlew clean / gradlew cleanBuildCache
  3. Re-installed node modules
  4. Cleaned android build cache
  5. Deleted /app/.gradle folder and re-generated
  6. Deleted /app/build folder and re-generated
  7. Reinstalled android studio
  8. Re-cloned repo
  9. Changed android build version from 30 to 31
  10. Removed react-native-cli from global using npm uninstall react-native-cli -g
  11. Wiped all my emulators data
  12. Added more memory to android virtual device
  13. Reinstalled yarn

I didn't make any changes to the repo or local dev env, build fails simply began on a random day I started working...

It's driving me nuts, any direction / advice would be appreciated

I went just until step 6, and then it worked :-)

alainib commented 3 months ago

how to let adb install -r -d abc.apk be runned while doing

yarn run android:envdev-debugbuild --active-arch-only