You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See #2703, looks like running react-native bundle and building with Gradle doesn't include the bundle in the APK.
Can you please document how to build release versions of Android apps? Should we release the Gradle plugin? Looks like react-native bundle is sufficient at this point. cc @kmagiera
changed the title [-][Android] `react-native bundle` to build a release APK[/-][+][Android] Building release APK with `react-native bundle`[/+]on Sep 16, 2015
I think we need a separate guide on building release versions of apps. "Using offline bundle" is only documented inside "Running On Device (iOS)" right now.
Yes, that'd be great. I could only find a short block of information about this topic on the Debugging page in the documentation (disabling developer mode for the app. And it doesn't include any information about the bundle command)
Download the bundle to the asset folder: curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
j6k4m8, jokester, kompot, chadguo, karan101292 and 6 more
Messed around with this for a while...seems like the only way (as of my writing this) to create a bundle for Android is to use the method that @krizpoon outlined above.
However it seems like the packager is excluding *.android.* files and throws the following error, despite /Users/hswolff/Sites/chartbeat/mobile_app/src/index.android.js existing:
➜ ~/Sites/chartbeat/mobile_app git:(phoenix) ✗ react-native bundle --url src/index.android.js --out android/app/src/main/assets/index.android.bundle --root src
Building package...
/Users/hswolff/Sites/chartbeat/mobile_app/node_modules/react-native/node_modules/promise/lib/done.js:10
throw err;
^
NotFoundError: Cannot find entry file src/index.android.js in any of the roots: ["/Users/hswolff/Sites/chartbeat/mobile_app","/Users/hswolff/Sites/chartbeat/mobile_app/src"]
at DependencyGraph._getAbsolutePath (/Users/hswolff/Sites/chartbeat/mobile_app/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/index.js:186:11)
at /Users/hswolff/Sites/chartbeat/mobile_app/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/index.js:141:28
at tryCallOne (/Users/hswolff/Sites/chartbeat/mobile_app/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
at /Users/hswolff/Sites/chartbeat/mobile_app/node_modules/react-native/node_modules/promise/lib/core.js:103:15
at flush (/Users/hswolff/Sites/chartbeat/mobile_app/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
at doNTCallback0 (node.js:407:9)
at process._tickCallback (node.js:336:13)
@hswolff This is due to the hardcoded blacklist param that results in the index.android.js getting ignored. Looks like this has been fixed on 0.12-stable.
Activity
[-][Android] `react-native bundle` to build a release APK[/-][+][Android] Building release APK with `react-native bundle`[/+]mkonicek commentedon Sep 16, 2015
I think we need a separate guide on building release versions of apps. "Using offline bundle" is only documented inside "Running On Device (iOS)" right now.
flipace commentedon Sep 16, 2015
Yes, that'd be great. I could only find a short block of information about this topic on the Debugging page in the documentation (disabling developer mode for the app. And it doesn't include any information about the bundle command)
cosmith commentedon Sep 16, 2015
+1 on the documentation. Also see #2712
krizpoon commentedon Sep 16, 2015
This works for me:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
hswolff commentedon Sep 24, 2015
Messed around with this for a while...seems like the only way (as of my writing this) to create a bundle for Android is to use the method that @krizpoon outlined above.
I tried:
However it seems like the packager is excluding
*.android.*
files and throws the following error, despite/Users/hswolff/Sites/chartbeat/mobile_app/src/index.android.js
existing:Even trying to do something clever like this:
Also throws the same error.
I imagine this will be looked at once the packager is in its own repo. For now I'm using the above outlined method.
javamonn commentedon Sep 30, 2015
@hswolff This is due to the hardcoded blacklist param that results in the index.android.js getting ignored. Looks like this has been fixed on 0.12-stable.
marty-wang commentedon Oct 3, 2015
can someone document the complete steps, from bundling all the way to installing the release version apk to device?
marty-wang commentedon Oct 3, 2015
I put together my steps here. Hopefully it will save people some time.
https://gist.github.com/marty-wang/5a71e9d0a6a2c6d6263c
jguffey commentedon Oct 6, 2015
+1
syarul commentedon Oct 6, 2015
+1
satya164 commentedon Oct 7, 2015
I have a pull request open here - #3061
kkganesan commentedon Oct 11, 2015
@marty-wang +1 for gist
37 remaining items