gradle - React native android code push installRelease build fails -
i trying add code push react native app, , followed steps mentioned in https://github.com/microsoft/react-native-code-push after doing it, debug build works fine use :
$ ./gradlew installdebug
but release build fails given following command :
$ ./gradlew installrelease
which gives following error :
:app:generatereleaseresources :app:mergereleaseresources :app:bundlereleasejsandassets failure: build failed exception. * went wrong: not list contents of '/users/jayshah/documents/testdir/exampleapp/node_modules/.bin/_mocha'.
github microsoft/react-native-code-push react-native-code-push - react native plugin codepush service.
i use following command generate bundle :
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
my react native version 0.18, code push version 0.16
turns out problem encountered when upgrading in react native pre 0.15 post 0.15 versions.
the react gradle task bundlereleasejsandassets seems culprit.
one can disable using
enabled config.bundleinrelease ?: false
in react.gradle or comment line (no guarantees work though)
inputs.files filetree(dir: reactroot, excludes: inputexcludes)
and manually made bundle file using react-native bundle command
react-native bundle --platform android --dev false --entry-file index.android.js \ --bundle-output android/app/src/main/assets/index.android.bundle \ --assets-dest android/app/src/main/res/
or curl based command
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
Helpful post. Thanks
ReplyDeleteReact Native Developer Freelancer