Closed naotoisoda closed 2 years ago
@naotoisoda Thank you for your report. I was able to reproduce your issue. To create an APK, I tried the method of creating an APK file from an AAB file.
The following was tried without changing the original files of our latest SDK package (v1.1), such as bundle.gradle. I have also run it in the example folder.
% 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/
To create the aab file.
% cd android
% ./gradlew bundleDebug
After converting the aab file to an apks file using the bundletool provided by Google, unzip it with the unzip command, which will output an apk file (universal.apk
).
% bundletool build-apks --mode=universal --bundle=app-debug.aab --output=app-debug.apks
% unzip app-debug.apks
I am afraid it is not your way, but I hope it helps.
@bandit-ibayashi Thank you for your support. Thanks to you , I could have made apk file.
Honestly speaking , on the way , I found I was able to distribute my test app by using aab file. So, I used aab file created on the process 4.below. Thus , I didn't use apk file created on the process 6.. The problem I wrote above is occured on creating apk file ,but not occured when creating aab file. But as a result , I could have solved my problem thanks to you. I appreciate your help.
Here is what I tried.
1.Download bundletool at https://github.com/google/bundletool/releases
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/
4.create the aab file.
cd android
./gradlew bundleDebug
→app-debug.aab was made on the android/app/build/outputs/bundle/debug
directory.
5.make universal.apk
bundletool build-apks --mode=universal --bundle=app/build/outputs/bundle/debug/app-debug.aab --output=app-debug.apks
→app-debug.apks was made on the android directory.
6.unzip
unzip app-debug.apks
→universal.apk was made on the android directory.
@naotoisoda I am glad to see that you have successfully achieved your goal!
@bandit-ibayashi this sounds like a great topic to add to the Wiki once we enable it on this repo.
I waned apk file. But, the process is stacked when assembling, though I can run app when doing
npx react-native run-android
.Here is what I tried.
1.
npx react-native run-android
→Complete. The app is available on the android and can print on the printer.2.I wanted apk file. So, I tried this.
react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/generated/assets/react/debug/index.android.bundle --assets-dest ./android/app/build/res/react/debug
./gradlew assembleDebug
→Error occured.
3.Then,i read this article. And ,do this. ・Create a new directory(aar_module) and put the following content into the build.gradle file withing the new directory:
・Place the stario10.aar into this new directoy.(aar_module) Next to the build.gradle file. ・Add the new created Gradle project to the settings.gradle file:
include(':aar-module')
・Include the project in the node_modules\react-native-star-io10\android\build.gradle・
./gradlew assembleDebug
→Error occured.(also doingnpx react-native run-android
)