我使用
react-native bundle --entry-file "index.android.js" --platform "android" --bundle-output "./assets/index.android.bundle" --verbose要打包JS代码包并将其放入资产中,它可以工作,但无法显示本地图像资源,本地图像资源位于./App/Img/文件夹中,用于:
const icon1 = require('./App/Img/slider.png');如何将这些资源文件打包,以便生成一个运行中的apk。
发布于 2016-05-03 11:37:49
我使用 bundle 命令将资源打包到android /文件夹中:
echo "START bundle for android normal resources release"
react-native bundle \
--platform android \
--entry-file index.android.js \
--bundle-output android/app/src/main/assets/index.android.bundle \
--assets-dest android/app/src/main/res/ \
--dev false然后用梯度构建:
./gradlew installReleasehttps://stackoverflow.com/questions/35567502
复制相似问题