Is there a plan for Capacitor to support Gradle 8?

I have an Android mobile app where I had to upgrade one of the 3rd-party libraries I am using. The upgrade required me to add a dependency in gradle for:

dependencies {
    implementation 'androidx.camera:camera-camera2:1.2.0'
}

After adding this dependency, Android Studio will no longer compile the project. The error is:

    Dependency 'androidx.camera:camera-view:1.2.0' requires libraries and applications that
    depend on it to compile against version 33 or later of the
    Android APIs.

    :app is currently compiled against android-32.

    Also, the maximum recommended compile SDK version for Android Gradle
    plugin 7.2.1 is 32.

    Recommended action: Update this project's version of the Android Gradle
    plugin to one that supports 33, then update this project to use
    compileSdkVerion of at least 33.

So now this cascade of dependencies makes it difficult to build the project. The 3rd-party library needs androidx.camera:camera-camera2 version 1.2.0. And this version of the androidx.camera requires Andoird API 33. And this version of Android API requires Gradle 8. But capacitor uses gradle 7.

Any suggestions on what to do about this? Is support for a newer version of gradle coming to Capacitor?

That’s not true, Android SDK 33 has been around since August, but gradle 8 was released in February this year, and android gradle plugin 8 was released last week (required for using gradle 8 in Android projects).

Anyway, Capacitor 5 will use gradle 8, it was updated yesterday, but still not released.
It was initially updated to use Android Gradle Plugin 7.4.1, which supports SDK 33.

You should be able to use Capacitor 5 beta to get rid of those errors.

3 Likes