我正在使用这个 命令:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle
输出
Scanning folders for symlinks in C:\Users\mgaba\Desktop\InfraGBU\node_modules (86ms)
Scanning folders for symlinks in C:\Users\mgaba\Desktop\InfraGBU\node_modules (94ms)
Loading dependency graph, done.
bundle: Writing bundle output to: android/app/src/main/assets/index.android.bundle
bundle: Done writing bundle output
**Assets destination folder is not set, skipping...
**
由于这个原因,我将无法看到APK中的图像。图片未加载此图片,请帮助消除此错误。
答案 0 :(得分:3)
尝试一下对我有用
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
答案 1 :(得分:1)
在项目目录中,打开终端/命令提示符,然后尝试以下命令:
react-native包--assets-dest ./android/app/src/main/res/ --entry-file ./index.android.js --bundle-output ./android/app/src/main /assets/index.android.bundle --platform android --dev false
然后遵循以下命令:
cd android
./gradlew installRelease或./gradlew assemblerelease
请注意,如果您有“ index.android.js”文件,请使用上述命令,否则将其替换为“ index.js”并使用以上命令。