callstack / super-app-showcase

Monorepository template for super app development with React Native and Re.Pack
MIT License
382 stars 63 forks source link

Build android apk release #64

Open michaelleung0o0 opened 9 months ago

michaelleung0o0 commented 9 months ago

I build successfully, but when i open the app it stuck on splash screen "Super App Showcase", it seems can't bundle the development server into the apk file, as the file size just around 22mb. So how to include all mini app into main "host" app when build the release apk file. thanks

jbroma commented 9 months ago

Hey @michaelleung0o0,

If you are running the super app showcase on android, you probably forgot to run yarn adb:reverse so the app fails to start as it can't fetch the auth module. If not - please provide more details about your environment, thanks!

michaelleung0o0 commented 9 months ago

i run -> yarn start, and then -> yarn adbreverse, then run -> yarn run:host:android. For this flow, it's work. I can access all the feature/ mini app That means i can run it successfully no matter android/ios

And then I wanna build a prod apk and hope that it will include all the mini app in "host", so that i setup all the android release setting, and run ./gradlew assembleRelease, It build successfully, but when i open the app, it just keep on splash screen "Super App Showcase". And I believe that I may miss some step, it should be need to bundle the other mini app into the "host" app. But i don't know how to do that

jbroma commented 9 months ago

When building for production, we are not bundling mini-apps into the host app, the idea is to have the mini-app bundles on a server/CDN and download them in runtime. So the following steps need to be done:

  1. Deploy the catalog-server with production bundles
  2. Build the app with env CATALOG_SERVER_URL=... where you should put an URL of your deployed catalog-server
michaelleung0o0 commented 9 months ago
  1. So for this example, i tried to run yarn bundle for all the mini app( auth, booking, dashboard, shell, shopping ), I saw a folder "android/remotes" will be generated and then deploy "catalog-server" in production server but i am not sure where should i push the generated files

  2. where can i find CATALOG_SERVER_URL?, i just see catalog-server -> getContainersURL -> hostname is a similar field. thanks for your help

Havanika28 commented 3 months ago

Unable to build apk file.It crashes. While creating a debug version , I am not able to fetch the miniapp data although I am bundling it. Please help out.