React-native: Task 'installRelease' not found in root project

Created on 16 Nov 2017  Â·  17Comments  Â·  Source: facebook/react-native

Is this a bug report?

yes

Have you read the Contributing Guidelines?

yes

Environment

Environment:
OS: Linux 4.13
Node: 6.11.4
Yarn: Not Found
npm: 3.10.10
Watchman: 4.7.0
Xcode: N/A
Android Studio: Not Found

Packages: (wanted => installed)
react: ^16.0.0 => 16.0.0
react-native: ^0.50.3 => 0.50.3

Steps to Reproduce

(Write your steps here:)

  1. cd android
  2. ./gradlew installRelease

Expected Behavior

release version of app is installed on connected device like in previous version of react-native

Actual Behavior

$ ./gradlew installRelease
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
Task 'installRelease' not found in root project 'AppName'. Some candidates are: 'uninstallRelease'.

* 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.

BUILD FAILED

Total time: 3.648 secs

Reproducible Demo

follow steps to reproduce

related issue

https://github.com/facebook/react-native/issues/16617

Ran Commands Locked

Most helpful comment

I was able to run manually: cd android && gradlew assembleRelease, but it's outputting app-release-unsigned.apk.

Edit:
It appears I was missing signingConfig in buildTypes > release. See example below:

...
android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
        }
    }
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
}
...

All 17 comments

$ react-native run-android --variant=release
Scanning folders for symlinks in /media/dj/dev/scan-app/node_modules (16ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installRelease)...
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
Task 'installRelease' not found in root project 'AppName'. Some candidates are: 'uninstallRelease'.

* 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.

BUILD FAILED

Total time: 1.283 secs
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/android-setup.html

i have the same issue

I was able to run manually: cd android && gradlew assembleRelease, but it's outputting app-release-unsigned.apk.

Edit:
It appears I was missing signingConfig in buildTypes > release. See example below:

...
android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
        }
    }
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
}
...

@BuffMcBigHuge useful, but assembleRelease not the same as installRelease

As @BuffMcBigHuge said, the problem is the missing singinConfig in gradle files. You have to proper configure it as described in https://facebook.github.io/react-native/docs/signed-apk-android.html and the installRelease will work.

i have also same issue and i tried to install using adb install that app-release-unsigned.apk it gives me error Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

i have the same issue

In addition to @BuffMcBigHuge , I also made the silly mistake of having my-release-key.keystore in [myApp]/android rather than [myApp]/andriod/app

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to Contribute • What to Expect from Maintainers

Still Happens on 0.55.2

Works for me

hello people,
i tried @BuffMcBigHuge solution but still getting same error
Task 'installRelease' not found in root project 'android'. Some candidates are: 'installDevRelease'.
i did everything as mentioned in docs, but i guess still missing out something

@Manoj002 Have you updated your android/app/build.gradle file to include the signingconfigs and then signingConfig signingConfigs.release inside of the buildTypes?

@segheysens , thanks for your response mate
i got it working by updating the gradle and by properly following the docs again!
though thanks mate!

I'm facing this issue, and I don't have the signing things in the Gradle file because I'm using Fastlane to do that instead.

Does that mean I have no option to test it?

Thank you @mayupat13 for pointing the adb install command, I'm able to run my app on the phone.

tenha certeza de ter gerado o certificado na pasta android/app/
veja como gerar em https://facebook.github.io/react-native/docs/signed-apk-android

android/app/buid.gradle
` // ...
signingConfigs {
release {

            storeFile file(MYAPP_RELEASE_STORE_FILE)
            storePassword MYAPP_RELEASE_STORE_PASSWORD
            keyAlias MYAPP_RELEASE_KEY_ALIAS
            keyPassword MYAPP_RELEASE_KEY_PASSWORD
    }
}
buildTypes {
    release {
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"

        signingConfig signingConfigs.release
    }
}

//...`

e no android/gradle.properties
`
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore

MYAPP_RELEASE_KEY_ALIAS=my-key-alias

MYAPP_RELEASE_STORE_PASSWORD=**

MYAPP_RELEASE_KEY_PASSWORD=**
`

Was this page helpful?
0 / 5 - 0 ratings