1
votes

I run the following:

$ adb reverse tcp:8081 tcp:8081 $ react-native run-android --configuration Release

And I get the following in response:

Release JS server already running.

Running adb -s HT68X0201778 reverse tcp:8081 tcp:8081

Generating the bundle for the release build... Unable to parse cache file. Will clear and continue. [01/07/2017, 19:52:45] Initializing Packager [01/07/2017, 19:52:45] Building Haste Map [01/07/2017, 19:52:47]
Building Haste Map (2085ms) [01/07/2017, 19:52:47]
Initializing Packager (2360ms) [01/07/2017, 19:52:47] Transforming files [01/07/2017, 19:52:48] Transforming files (1530ms)

bundle: start bundle:

finish bundle: Writing bundle output

to: android/app/src/main/assets/index.android.bundle

ENOENT: no such file or directory, open 'android/app/src/main/assets/index.android.bundle'

I tried running it as sudo as well, with no luck.

UPDATE: I manually created the 'assets' folder inside of 'android/app/src/main/' and ran it again. This time it got further, but still failed with the following:

FAILURE: Build failed with an exception.

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

1
In the /android directory run the command ./gradlew tasks. This should give you a list of all tasks available it might be that the installRelease tasks not exists or somehow the react-native cli command is running the glradle command from the wrong directory. you can run the same command directly with gradlew though. - tijs
Have you setup the gradle signing config? - max23_
@tijs, thanks for the insight... - Anthony Tietjen
@max23_ I think the link you provided me was the most helpful for my scenario. If you want to provide your response as an Answer, I will mark it as The Answer. - Anthony Tietjen
I have added as an answer, glad it helps. - max23_

1 Answers

1
votes

Based on the documentation, "installRelease" gradle task will only available after editing the app's gradle at android/app/build.gradle with the following:

Please take note on the signingConfigs and buildTypes configs.

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
        }
    }
}