Search code examples
androidreact-native

Execution failed for task ':app:installRelease' react-native


I wanted to create an android apk file in react-native. I followed the instructions as per the link below

https://reactnative.dev/docs/signed-apk-android

  1. Generated upload key
  2. Added gradle variables
  3. Added signing config

this worked well but for below command I am getting an error

npx react-native run-android --variant=release

Error:

Task :app:installRelease FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:installRelease'.

    com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package io.nativebase.market.geekyants.straptaxiapp signatures do not match previously installed version; ignoring!

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 20s 65 actionable tasks: 2 executed, 63 up-to-date error Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html error Command failed: ./gradlew app:installRelease. Run CLI with --verbose flag for more details.strong text

Please help..!


Solution

  • I had the same problem before. Check that you don't have any other version of the app installed in your phone. If this is the case, uninstall the previous version and it will work fine.

    If that does not work, try updating the version number in the app/build.gradle in the android folder.

    I hope it helps.