Skip to content

Comments

Upgrade/agp 9.0.1#284

Open
wassupluke wants to merge 4 commits intojrpie:masterfrom
wassupluke:upgrade/agp-9.0.1
Open

Upgrade/agp 9.0.1#284
wassupluke wants to merge 4 commits intojrpie:masterfrom
wassupluke:upgrade/agp-9.0.1

Conversation

@wassupluke
Copy link
Contributor

Heavy lifting shouldTM be done. Builds, installs, and runs without notable issues in moderately thorough testing.

Android Migration Documentation and a Reddit post of someone struggling to migrate their KMP (Kotlin Multi-Platform) app, thank goodness we're not dealing with multiplatform or I'd have given up.

What Changed

Migrate to built-in Kotlin

The org.jetbrains.kotlin.android plugin is not compatible with the new DSL.

Remove the kotlin-android plugin

The heading says it all

Migrate the kotlin-kapt plugin

org.jetbrains.kotlin.kapt ➡️ com.android.legacy-kapt

Migrate the android.kotlinOptions{} DSL

android {
    kotlinOptions {
       ...
    }
}

⬇️ ⬇️ ⬇️

kotlin {
    compilerOptions {
       ...
    }
}

They even say the entire android{} block is unnecessary now, though I have left it in for what it is worth.

Migrate the kotlin.sourceSets{} DSL

Accrescent has already been somewhat of a bugger to cooperate with releases. I have zero clue if this part is correct, so please validate this works for the Accrescent folks. See here for more information on the migration.

Bump library versions

Notable exception to library version bumps: activity and activity-ktx stayed at 1.11.0 as 1.12.4 ups the minimum SDK to 23 (Android 6.0) from 21 (Android 5.0).

Build Warnings

app:kaptDefaultDebugKotlin

Supported source version 'RELEASE_11' from annotation processor 
'org.jetbrains.kotlin.kapt.base.ProcessorWrapper' less than -source '17'

I believe this stems from kapt asking for 11 instead of 17 for whatever reason.

app:compileDefaultDebugKotlin

LauncherAction.kt

Custom serializer 'LauncherActionSerializer' is private, while the type 'LauncherAction' is 
not. This can cause 'serializer not found' errors on use sites. Consider aligning the 
visibilities.

Android Studio Commit Warnings

app/build.gradle.kts

Warning:(75, 9) 'setGenerateLocaleConfig(boolean)' is marked unstable with @Incubating

Lots of depreciation warnings to address:

The option setting 'android.usesSdkInManifest.disallowed=false' is deprecated.
The option setting 'android.sdk.defaultTargetSdkToCompileSdkIfUnset=false' is deprecated.
The option setting 'android.enableAppCompileTimeRClass=false' is deprecated.
The option setting 'android.builtInKotlin=false' is deprecated.
The option setting 'android.newDsl=false' is deprecated.
The option setting 'android.r8.optimizedResourceShrinking=false' is deprecated.
The option setting 'android.defaults.buildfeatures.resvalues=true' is deprecated.
The property android.dependency.excludeLibraryComponentsFromConstraints improves project import performance for v>
:app:kaptDefaultDebugKotlin
        Supported source version 'RELEASE_11' from annotation processor 'org.jetbrains.kotlin.kapt.base.Processor>
:app:compileDefaultDebugKotlin
        ManageWidgetsActivity.kt
        SelectWidgetActivity.kt

The gradle.properties additions are the defaults from the Android Studio AGP Upgrade Assistant process and may need addressed as part of resolving up the depreciation warnings.
Notable exception to library version bumps: activity and activity-ktx stayed at 1.11.0 as 1.12.4 ups the minimum SDK to 23 (Android 6.0) from 21 (Android 5.0).

Builds, installs, and runs without notable issues in moderately thorough testing.

## Warnings

### settings.gradle.kts
Warning:(19, 5) 'getRepositoriesMode()' is marked unstable with @Incubating
Warning:(19, 26) 'org.gradle.api.initialization.resolve.RepositoriesMode' is marked unstable with @Incubating
Warning:(19, 43) 'FAIL_ON_PROJECT_REPOS' is declared in unstable enum 'org.gradle.api.initialization.resolve.RepositoriesMode' marked with @Incubating
Warning:(20, 5) 'repositories(org.gradle.api.Action<? super org.gradle.api.artifacts.dsl.RepositoryHandler>)' is marked unstable with @Incubating

### app/build.gradle.kts

Warning:(75, 9) 'setGenerateLocaleConfig(boolean)' is marked unstable with @Incubating
Not entirely sure on this.
This and the settings.gradle.kts file change go together. Theoretically they work with Android Studio to make the gradle environment more consistent across devices for more consistent java runtimes. 🤷
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