woheller69 / browser

A privacy oriented web browser with Greasemonkey style script support and Cookie Banner Blocker
GNU General Public License v3.0
160 stars 18 forks source link

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

Open StevanWhite opened 1 week ago

StevanWhite commented 1 week ago

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 commented 1 week ago

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

StevanWhite commented 1 week ago

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.