2
votes

sorry for my English, this is my first issues

Hi, I created a issus https://github.com/facebook/react-native/issues/4124

I can run perfect react-native start / react-native run-android and it works great


  • SO: windows 10
  • node: 4.2.2
  • npm: 2.14.7
  • react-native: 0.1.7

I followed this tutorial completely accurate https://facebook.github.io/react-native/docs/signed-apk-android.html#content

1- the key gender [ok]

2

2- Edit the file ~/.gradle/gradle.properties [ok]

screenshot_2

3- Adding signing config to your app's gradle config (android/app/build.gradle)

screenshot_3


launch command ./gradlew assembleRelease


The error is as follows screenshot_1

did not find the command-native react

screenshot_4

then we change the absolute path

// set up the call to the react-native cli
workingDir reactRoot
commandLine "C:/Users/yo/AppData/Roaming/npm/react-native.cmd", "bundle", "--platform", "android", "--dev", "false", "--entry-file",
        entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease

in this case, it fails. It is infinite loading

:app:prepareComFacebookReactReactNative0140Library UP-TO-DATE
:app:prepareComGoogleAndroidExoplayerExoplayerR151Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareReleaseDependencies
:app:compileReleaseAidl UP-TO-DATE
:app:compileReleaseRenderscript UP-TO-DATE
:app:generateReleaseBuildConfig UP-TO-DATE
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets UP-TO-DATE
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources UP-TO-DATE
> Building 79% > :app:bundleReleaseJsAndAssets

test without key file (is exactly the same)

After testing several commands.

./gradlew --info assembleRelease

If I wait long at the end I get an error

enter image description here

2

2 Answers

1
votes

Make sure react-native is installed globally by running install command with -g npm install -g react-native-cli

0
votes

Try to run the build again with --debug or --info options like this

./gradlew --debug assembleRelease
                OR
./gradlew --info assembleRelease

Usually it gives you some stacktrace to the caused of error.

From my view, I don'e see any problem with your signing config (if you are sure that the password, alias for the keystore file is correct). I think it is more like a problem with settings for 'react-native'

One more tip, the following line from android/app/build.gradle can be removed. As your signing config has name 'release' which will be automatically picked for signing release build. Same case for 'debug' also.

signingConfig signingConfigs.release

So, if you wanna try to build with default keystore to see if it is keystore config problem. You will have to remove all the green highlighted part in part 3