Skip to content

Reduce android example APK size#8932

Merged
mockersf merged 1 commit intobevyengine:mainfrom
NiklasEi:reduce_example_apk_size
Jul 5, 2023
Merged

Reduce android example APK size#8932
mockersf merged 1 commit intobevyengine:mainfrom
NiklasEi:reduce_example_apk_size

Conversation

@NiklasEi
Copy link
Copy Markdown
Member

Objective

The current mobile example produces an APK of 1.5 Gb.

  • Running the example on a real device takes significant time (around one minute just to copy the file over USB to my phone).
  • Default virtual devices in Android studio run out of space after the first install. This can of course be solved/configured, but it causes unnecessary friction.
  • One impression could be, that Bevy produces bloated APKs. 1.5Gb is even double the size of debug builds for desktop examples.

Solution

  • Strip the debug symbols of the shared libraries before they are copied to the APK

APK size after this change: 200Mb
Copy time on my machine: ~8s

Considered alternative

APKs built in release mode are only 50Mb in size, but require setting up signing for the profile and compile longer.

@NiklasEi NiklasEi added C-Examples An addition or correction to our examples O-Android Specific to the Android mobile operating system labels Jun 22, 2023
@james7132 james7132 requested a review from mockersf July 5, 2023 21:56
@james7132 james7132 added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jul 5, 2023
@mockersf mockersf added this pull request to the merge queue Jul 5, 2023
Merged via the queue into bevyengine:main with commit b61397e Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Examples An addition or correction to our examples O-Android Specific to the Android mobile operating system S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants