Skip to content

Migrate to AGP 9.0 built-in Kotlin support#435

Merged
hossain-khan merged 5 commits into
mainfrom
update-agp-gradle
Apr 15, 2026
Merged

Migrate to AGP 9.0 built-in Kotlin support#435
hossain-khan merged 5 commits into
mainfrom
update-agp-gradle

Conversation

@hossain-khan
Copy link
Copy Markdown
Owner

Summary

This PR migrates the project to Android Gradle Plugin (AGP) 9.0's built-in Kotlin support, eliminating deprecation warnings and modernizing the build configuration.

Changes

  • Removed deprecated plugin: org.jetbrains.kotlin.android from app/build.gradle.kts
  • Updated gradle.properties:
    • Removed deprecated settings: android.builtInKotlin=false, android.newDsl=false
    • Removed other deprecated AGP 8.x compatibility flags
    • Added android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false to suppress build warnings

Benefits

✅ Clean build output with zero warnings
✅ Uses AGP 9.0's modern built-in Kotlin support
✅ Improved build performance
✅ No more deprecation warnings

Build Status

  • ./gradlew assembleDebug - SUCCESS (300ms)
  • ✅ All tasks up-to-date
  • ✅ No compilation errors

Related

See: https://kotl.in/gradle/agp-built-in-kotlin for AGP 9.0 migration details

- Remove deprecated kotlin.android plugin from build.gradle.kts
- Remove deprecated gradle.properties settings (builtInKotlin, newDsl, etc.)
- Enables AGP 9.0's modern built-in Kotlin support
- Eliminates deprecation warnings
Add android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false to suppress the build warning about dependency constraints optimization.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Code Coverage Report

View Coverage Report

Extract the following embedded versions to [versions] section for consistent dependency management:
- robolectric: 4.16.1
- google-services plugin: 4.4.4
- firebase-crashlytics plugin: 3.0.6
- kotlinx-kover plugin: 0.9.8

This improves centralized version management and maintainability.
- metro: 0.13.1 → 0.13.2
- firebaseBom: 34.11.0 → 34.12.0
- firebaseCrashlytics: 3.0.6 → 3.0.7
- kotlinxSerializationJson: 1.10.0 → 1.11.0
- kotlinxSerializationProperties: 1.10.0 → 1.11.0
- Remove unused android-library plugin definition
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

📊 APK Size Analysis

Comparing mainupdate-agp-gradle (this PR)

OLD: base.apk (signature: V2)
NEW: app-release.apk (signature: V2)

          │             compressed             │            uncompressed            
          ├───────────┬───────────┬────────────┼───────────┬───────────┬────────────
 APK      │ old       │ new       │ diff       │ old       │ new       │ diff       
──────────┼───────────┼───────────┼────────────┼───────────┼───────────┼────────────
      dex │   6.9 MiB │   6.7 MiB │ -220.8 KiB │   6.9 MiB │   6.7 MiB │ -220.8 KiB 
     arsc │ 434.4 KiB │ 370.7 KiB │  -63.7 KiB │ 434.3 KiB │ 370.6 KiB │  -63.7 KiB 
 manifest │   3.7 KiB │   3.7 KiB │        0 B │  16.8 KiB │  16.8 KiB │        0 B 
      res │ 160.8 KiB │ 126.1 KiB │  -34.8 KiB │ 198.5 KiB │ 168.3 KiB │  -30.2 KiB 
   native │  73.1 KiB │  64.3 KiB │   -8.8 KiB │  71.9 KiB │    63 KiB │   -8.8 KiB 
    asset │  49.5 KiB │  55.4 KiB │     +6 KiB │ 137.2 KiB │ 143.2 KiB │     +6 KiB 
    other │  74.7 KiB │  74.6 KiB │      -62 B │ 155.4 KiB │ 154.9 KiB │     -473 B 
──────────┼───────────┼───────────┼────────────┼───────────┼───────────┼────────────
    total │   7.7 MiB │   7.4 MiB │ -322.2 KiB │   7.9 MiB │   7.6 MiB │ -318.1 KiB 

 DEX     │ old   │ new   │ diff                  
─────────┼───────┼───────┼───────────────────────
   files │     1 │     1 │     0                 
 strings │ 35610 │ 34047 │ -1563 (+7273 -8836)   
   types │  9570 │  9115 │  -455 (+6784 -7239)   
 classes │  8193 │  7750 │  -443 (+6391 -6834)   
 methods │ 43956 │ 43378 │  -578 (+34383 -34961) 
  fields │ 26356 │ 26019 │  -337 (+22616 -22953) 

 ARSC    │ old │ new │ diff            
─────────┼─────┼─────┼─────────────────
 configs │ 109 │ 105 │   -4 (+0 -4)    
 entries │ 424 │ 273 │ -151 (+14 -165)
APK
       compressed       │      uncompressed      │                                                                                         
───────────┬────────────┼───────────┬────────────┤                                                                                         
 size      │ diff       │ size      │ diff       │ path                                                                                    
───────────┼────────────┼───────────┼────────────┼─────────────────────────────────────────────────────────────────────────────────────────
   6.7 MiB │ -220.8 KiB │   6.7 MiB │ -220.8 KiB │ ∆ classes.dex                                                                           
 370.7 KiB │  -63.7 KiB │ 370.6 KiB │  -63.7 KiB │ ∆ resources.arsc                                                                        
  12.2 KiB │   +5.3 KiB │  12.1 KiB │   +5.3 KiB │ ∆ assets/dexopt/baseline.prof                                                           
   7.8 KiB │   -2.5 KiB │   7.6 KiB │   -2.5 KiB │ ∆ lib/arm64-v8a/libdatastore_shared_counter.so                                          
   5.9 KiB │   -2.5 KiB │   5.8 KiB │   -2.5 KiB │ ∆ lib/armeabi-v7a/libdatastore_shared_counter.so                                        
   2.2 KiB │   +2.2 KiB │   5.3 KiB │   +5.3 KiB │ + res/Ls.xml                                                                            
   7.3 KiB │     -2 KiB │   7.2 KiB │     -2 KiB │ ∆ lib/x86_64/libdatastore_shared_counter.so                                             
   6.1 KiB │   -1.8 KiB │     6 KiB │   -1.8 KiB │ ∆ lib/x86/libdatastore_shared_counter.so                                                
           │   -1.7 KiB │           │   -1.6 KiB │ - res/us.9.png                                                                          
           │   -1.6 KiB │           │   -1.5 KiB │ - res/zw.9.png                                                                          
           │   -1.5 KiB │           │   -1.4 KiB │ - res/_p.png                                                                            
   1.5 KiB │   +1.5 KiB │   3.1 KiB │   +3.1 KiB │ + res/VV.xml                                                                            
           │   -1.3 KiB │           │   -1.2 KiB │ - res/I3.9.png                                                                          
           │   -1.2 KiB │           │   -1.1 KiB │ - res/w2.9.png                                                                          
           │   -1.2 KiB │           │   -1.1 KiB │ - res/ZL.9.png                                                                          
           │   -1.1 KiB │           │     -1 KiB │ - res/5J.9.png                                                                          
   1.1 KiB │   +1.1 KiB │   5.6 KiB │   +5.6 KiB │ + res/Dk.xml                                                                            
           │   -1.1 KiB │           │     -982 B │ - res/-p.png                                                                            
           │     -1 KiB │           │     -960 B │ - res/tr.9.png                                                                          
           │   -1,005 B │           │     -909 B │ - res/pu.png                                                                            
           │     -997 B │           │     -897 B │ - res/BQ.9.png                                                                          
           │     -908 B │           │     -808 B │ - res/hP.9.png                                                                          
           │     -904 B │           │     -808 B │ - res/iW.png                                                                            
           │     -882 B │           │   -2.4 KiB │ - res/6f.xml                                                                            
           │     -876 B │           │     -776 B │ - res/Qd.9.png                                                                          
           │     -847 B │           │   -1.7 KiB │ - META-INF/app_release.kotlin_module                                                    
     831 B │     +831 B │   1.7 KiB │   +1.7 KiB │ + META-INF/app.kotlin_module                                                            
           │     -823 B │           │     -727 B │ - res/vo.png                                                                            
           │     -79
...✂
DEX
STRINGS:

   old   │ new   │ diff                
  ───────┼───────┼─────────────────────
   35610 │ 34047 │ -1563 (+7273 -8836) 
  
  +

- Use .set() method for reportsDestination property (new DSL style)
- Use layout.buildDirectory.dir() instead of .asFile.get().resolve()
- Remove deprecated enableKotlinVersionCompatibilityChecks property
- Update documentation links to point to 0.13.2 docs

Metro 0.13.2 uses typed properties with .set() methods instead of direct assignment.
@hossain-khan hossain-khan merged commit 5c33fad into main Apr 15, 2026
4 checks passed
@hossain-khan hossain-khan deleted the update-agp-gradle branch April 15, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant