Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Agenda

Slide 3

Slide 3 text

Agenda › AppBundle

Slide 4

Slide 4 text

Agenda › AppBundle › Universal APK

Slide 5

Slide 5 text

Agenda › AppBundle › Universal APK › LINE Android CI Systems

Slide 6

Slide 6 text

Agenda › AppBundle › Universal APK › LINE Android CI Systems › AGP bugs related Aab

Slide 7

Slide 7 text

Agenda › AppBundle › Universal APK › LINE Android CI Systems › AGP bugs related Aab › How to solve these issues

Slide 8

Slide 8 text

AppBundle

Slide 9

Slide 9 text

AppBundle Upload format on Google Play Store › Google Play converts optimized “Split Apk” for devices by configuration and dynamic features › Cannot installable on devices

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

Universal APK

Slide 13

Slide 13 text

Universal APK › Google Play is no longer required for distribution. › Can distribute installable with single file. Pros

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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…

Slide 17

Slide 17 text

Changes of LINE Android CI System

Slide 18

Slide 18 text

Changes of LINE Android CI System 1BDLBHJOH 6OJU5FTU -JOU

Slide 19

Slide 19 text

Changes of LINE Android CI System 1BDLBHJOH 6OJU5FTU -JOU "QL BQQBTTFNCMF%FCVH BQQUFTU%FCVH6OJU5FTU BQQMJOU%FCVH

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

Solution: Use latest bundle tool build.gradle.kts

Slide 25

Slide 25 text

Solution: Use latest bundle tool build.gradle.kts

Slide 26

Slide 26 text

Solution: Use latest bundle tool build.gradle.kts

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

Solution: Add dependencies explicitly

Slide 30

Slide 30 text

Conclusion

Slide 31

Slide 31 text

Conclusion › There are several bugs related with AppBundle in build tools. › CI System has a variety of requirements that Google did not expect.

Slide 32

Slide 32 text

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.

Slide 33

Slide 33 text

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.

Slide 34

Slide 34 text

See also

Slide 35

Slide 35 text

See also › Best Practices for a modularized app with dynamic features by Leo Chu

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

Thank you