Reduce APK size, add debug symbols to AAB #2790
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem1: we do not have native debug symbols in AAB ; fix #2147
Problem2: current APKs are now ~500MB, with old build it was ~90MB
Explanation of the existing situation:
New vckpg based android SDK is not compiled with
-g
as before (compare https://github.com/MerginMaps/input-sdk/blob/378d1bf861c940fb995ecdfaef9d22b0f4663992/vcpkg-overlay/triplets/arm64-android.cmake#L9 and https://github.com/MerginMaps/input-sdk/blob/472f8daee008f33a9d08c8c0f51904b114f2306d/android/distribute.sh#L361)As NDK's cmake toolchain adds it by default (see android/ndk#243) we need to either compile with
-g0
as before for release, or RATHERstripDebugDebugSymbols
from gradle. This would allow us to have debug symbols too, so it is preferred optionunfortunately we are experiencing the bug similar to this facebook/react-native#32857
Fix
-g0
from Input build - so now all build types has debug info (as is standard in Android Studio builds - it is stripped by Gradle)android.ndkPath
which is required to stripDebugSymbols task to work.SYMBOL_TABLE
- size of debug symbol 68 MB (see https://developer.android.com/build/shrink-code), since withFULL
the native debug symbols zip had 418 MB (above 300 MB limit) ; With this setting we should see all function names of ALL libraries (probably except Qt's, but definitely QGIS, GDAL, etc). We will NOT see line numbers and file-names. If we want to see that for QGIS/Input, we would need to compile input-sdk in a way that selected libraries (let say all but QGIS) will be compiled with-g0
and without all debug symbols altogether