browser icon indicating copy to clipboard operation
browser copied to clipboard

Upgrade for Android Studio 2024.1.1, Gradle 8.7, JDK 17

Open StevanWhite opened this issue 8 months ago • 2 comments

This is just to make it easier for you, if and when you choose to update. (Probably better sooner than later)

I have done this. It builds and runs well, near as I can tell. It wasn't very hard --- but there were pitfalls.

Start with the AGP Upgrade Assistant.

After recommended update to Gradle plugin 7.4.2?,

Update all library dependencies.

Then run AGP Upgrade Assistant again to update Gradle to 8.5. See a warning:

The option setting 'android.defaults.buildfeatures.buildconfig=true' is deprecated.

Removed that line from config.

Some other suggestions do actually seem to improve build time:

android.enableJetifier=false
org.gradle.configuration-cache=true

At this point, build will complain:

Cannot find symbol BuildConfig

Added to build.gradle inside android{},

buildFeatures {
    buildConfig = true
}

At this point, it builds, and has basic functionality. Anyway I browsed around, clicked on things, added bookmarks, etc. (I don't know your testing procedures.)

I went on to bump the JDK versions to 17.
Don't forget:

kotlinOptions {
    jvmTarget = '17'
}

(You may have to check that Gradle is using the Studio distribution jbr 17.)

Cheers!

StevanWhite avatar Jun 19 '24 21:06 StevanWhite