react-native run-android --variant=release does not work currently.

See original GitHub issue

Description

cannot test release variant on android.

Reproduction

in console at root of project run

react-native run-android --variant=release

JS server already running. Running /usr/local/opt/android-sdk/platform-tools/adb -s 192.168.56.101:5555 reverse tcp:8081 tcp:8081 Building and installing the app on the device (cd android && ./gradlew installReleaseDebug)… Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

  • What went wrong: Task ‘installReleaseDebug’ not found in root project ‘mysupercoolapp’.

  • Try: Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Solution

I can get it to work doing cd android && ./gradlew installRelease. Maybe the react-native command needs to be remapped to a different gradle command?

Additional Information

Someone else got this 7 hours ago on SO as well: http://stackoverflow.com/questions/41263330/error-running-react-native-run-android-variant-release-task-installreleasede

  • React Native version: 0.39.x
  • Platform: Android
  • Operating System: MacOS

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:26 (3 by maintainers)

github_iconTop GitHub Comments

48reactions
Ehespcommented, Dec 22, 2016

Yeah so this was a problem I had. Turns out there was a PR created which changed this but the documentation was also not updated. I’ll try and find the PRs for the change and docs (which hasn’t merged).

For now run:

react-native run-android --configuration=release

PR for the change: https://github.com/facebook/react-native/pull/10867#issuecomment-266769510 PR for the docs change: https://github.com/facebook/react-native/pull/11443

22reactions
trubincommented, Apr 4, 2017

So it seems to be because I forgot to include “signingConfig signingConfigs.release” in the “release” property of the “buildTypes” property of the app\build.gradle.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"react-native run-android --variant=release" removes index ...
So it appears that some process within the "react-native run-android --variant=release" command deleted the index.android.bundle file generated ...
Read more >
Running On Device - React Native
Method 2: Connect via Wi-Fi​ · Make sure your laptop and your phone are on the same Wi-Fi network. · Open your React...
Read more >
The missing guide to React Native app variants — Part 1
This use case needs a native Android/iOS code setup, which could be scary for Javascript developers. But don't worry: stay with me and...
Read more >
react-native run-android - Fig.io
Options ; --variant <variant>, Specify your app's build variant (default: "debug") ; --appFolder <string>, [DEPRECATED – use "project.android.appName" in react- ...
Read more >
Known issues with Android Studio and Android Gradle Plugin
To fix this issue, upgrade your Android 11 emulator to version 9 or higher by navigating to Tools > SDK Manager. In the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found