Share
Embed
Sharing experience of adapting AppBundle on LINE Android CI.
Young Cha
LINE Plus LINE App 1 Android Engineer
https://linedevday.linecorp.com/2020/ja/sessions/5456
https://linedevday.linecorp.com/2020/en/sessions/5456
LINE DevDay 2020
November 26, 2020
Transcript
38 slides
-
Agenda › AppBundle › Universal APK › LINE Android CI
Systems › AGP bugs related Aab -
Agenda › AppBundle › Universal APK › LINE Android CI
Systems › AGP bugs related Aab › How to solve these issues -
AppBundle Upload format on Google Play Store › Google Play
converts optimized “Split Apk” for devices by configuration and dynamic features › Cannot installable on devices -
AppBundle › Recommended to use latest AGP version Requires Android
Gradle Plugin 3.2 or higher Upload format on Google Play Store › Google Play converts optimized “Split Apk” for devices by configuration and dynamic features › Cannot installable on devices -
AppBundle › Recommended to use latest AGP version Requires Android
Gradle Plugin 3.2 or higher Inconvenient use for in-house distribution › LINE Android team uses “Universal APK” to distribute in-house Upload format on Google Play Store › Google Play converts optimized “Split Apk” for devices by configuration and dynamic features › Cannot installable on devices -
Universal APK › Google Play is no longer required for
distribution. › Can distribute installable with single file. Pros -
Universal APK › Google Play is no longer required for
distribution. › Can distribute installable with single file. Pros Cons › Cannot determine real distribution size. › Minor settings can be differ with real distribution › ABI › Compression Level -
Universal APK › Google Play is no longer required for
distribution. › Can distribute installable with single file. Pros Cons › Cannot determine real distribution size. › Minor settings can be differ with real distribution › ABI › Compression Level How to build universal apk (without bundletool) › $ ./gradlew :app:packageDebugUniversalApk › $ ls app/build/outputs/universal_apk/debug › app-debug-universal.apk -
LINE Android CI Systems › App packaging › Deploy Universal
Apk on In-House repository for Pre-QA, QA team › Deploy AppBundle on Google Play for Dogfooding, Alpha and Production Release Pipeline Pull Request Checkers › App packaging : Universal App, AppBundle › UnitTest based Robolectric › Code formatter / Lint Checker › Etc… -
Changes of LINE Android CI System 1BDLBHJOH 6OJU5FTU -JOU "QL
BQQBTTFNCMF%FCVH BQQUFTU%FCVH6OJU5FTU BQQMJOU%FCVH -
Changes of LINE Android CI System 1BDLBHJOH 6OJU5FTU -JOU "QL
BQQBTTFNCMF%FCVH BQQUFTU%FCVH6OJU5FTU BQQMJOU%FCVH "QQ#VOEMF BQQCVOEMF%FCVH BQQQBDLBHF%FCVH6OJWFSTBM"QL BQQUFTU%FCVH6OJU5FTU GFBUVSFUFTU%FCVH6OJU5FTU GFBUVSFUFTU%FCVH6OJU5FTU ʜ BQQMJOU%FCVH TJODF"(1 -
Issues related with Universal App > Task :app:packageDebugUniversalApk FAILED Error:
Program type already present: $r8$backportedMethods$utility$Long$1$hashCode › https://issuetracker.google.com/issues/146265847 AGP 3.6 AGP 3.4, 3.5 > Task :app:packageDebugUniversalApk FAILED Error: Program type already present: $r8$java8methods$utility$Long$hashCode$IJ › https://issuetracker.google.com/issues/139993729 -
Issues related with Universal App > Task :app:packageDebugUniversalApk FAILED Error:
Program type already present: $r8$backportedMethods$utility$Long$1$hashCode › https://issuetracker.google.com/issues/146265847 AGP 3.6 AGP 3.4, 3.5 > Task :app:packageDebugUniversalApk FAILED Error: Program type already present: $r8$java8methods$utility$Long$hashCode$IJ › https://issuetracker.google.com/issues/139993729 -
Issues related with Universal App > Task :app:packageDebugUniversalApk FAILED Error:
Program type already present: $r8$backportedMethods$utility$Long$1$hashCode › https://issuetracker.google.com/issues/146265847 AGP 3.6 AGP 3.4, 3.5 > Task :app:packageDebugUniversalApk FAILED Error: Program type already present: $r8$java8methods$utility$Long$hashCode$IJ › https://issuetracker.google.com/issues/139993729 -
Issues related with UnitTest AGP 3.2 ~ AGP 4.0 ›
Cannot perform robolectric tests for Dynamic Feature by ClassLoader failure > Task :dynamicfeature:testDebugUnitTest FAILED com.bugexample.dynamicfeature.FeatureModuleDataHelperTest > Fails at runtime with NoClassDefFoundError when running testDebugUnitTest FAILED java.lang.NoClassDefFoundError at FeatureModuleDataHelperTest.kt:11 Caused by: java.lang.ClassNotFoundException at FeatureModuleDataHelperTest.kt:11 › https://issuetracker.google.com/issues/123441249 -
Issues related with UnitTest AGP 3.2 ~ AGP 4.0 ›
Cannot perform robolectric tests for Dynamic Feature by ClassLoader failure > Task :dynamicfeature:testDebugUnitTest FAILED com.bugexample.dynamicfeature.FeatureModuleDataHelperTest > Fails at runtime with NoClassDefFoundError when running testDebugUnitTest FAILED java.lang.NoClassDefFoundError at FeatureModuleDataHelperTest.kt:11 Caused by: java.lang.ClassNotFoundException at FeatureModuleDataHelperTest.kt:11 › https://issuetracker.google.com/issues/123441249 -
Conclusion › There are several bugs related with AppBundle in
build tools. › CI System has a variety of requirements that Google did not expect. -
Conclusion › Search your issue on AOSP issue tracker(http://b.android.com), and
give ⭐ › If there is no issue you have, please submit and share. › There are several bugs related with AppBundle in build tools. › CI System has a variety of requirements that Google did not expect. -
Conclusion › Search your issue on AOSP issue tracker(http://b.android.com), and
give ⭐ › If there is no issue you have, please submit and share. › Collaborate with Googler to fix bugs › Provide MWE(Minimal Working Example) › Also most source codes of AGP are opened, and we can find out the cause of the problem. › There are several bugs related with AppBundle in build tools. › CI System has a variety of requirements that Google did not expect. -
See also › Best Practices for a modularized app with
dynamic features by Leo Chu -
See also › References from android developer documentations › About
Android App Bundles : https://d.android.com/guide/app-bundle › bundletool : https://d.android.com/studio/command-line/bundletool › Best Practices for a modularized app with dynamic features by Leo Chu -
See also › References from android developer documentations › About
Android App Bundles : https://d.android.com/guide/app-bundle › bundletool : https://d.android.com/studio/command-line/bundletool › AOSP Issue tracker › appbundle › Android Gradle Plugin › Best Practices for a modularized app with dynamic features by Leo Chu