Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade for Android Studio 2024.1.1, Gradle 8.7, JDK 17 #50

Open
StevanWhite opened this issue Jun 19, 2024 · 2 comments
Open

Upgrade for Android Studio 2024.1.1, Gradle 8.7, JDK 17 #50

StevanWhite opened this issue Jun 19, 2024 · 2 comments

Comments

@StevanWhite
Copy link

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!

@woheller69
Copy link
Owner

I will upgrade at the time it does not compile anymore.
By that time there will be new and or other pitfalls.

@StevanWhite
Copy link
Author

As I said, this is just to make it easier on you --- if and when.

Let me say, a couple of these things could be done without upgrading the IDE or Gradle.
In particular, the Buildconfig stuff... the old directive is already deprecated.
And working with Java 11 has already started to feel a little restrictive to me.

Waiting until it breaks sounds a little masochistic... but it's your project.

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

No branches or pull requests

2 participants