Skip to content

Conversation

@jkasten2
Copy link
Member

@jkasten2 jkasten2 commented Mar 4, 2025

Description

One Line Summary

Upgrade to latest production AGP and it's supported Gradle version.

Details

Motivation

There are two reasons:

  • Gradle 7 and APG 7 are legacy, which means they no longer get many updates
  • The latest versions of Android Studio come with JDK 21, which doesn't work for Gradle 7 and AGP 7.
    • NOTE: Publishing still need to be done with Java 17 however, explained below.

Scope

Just updated what is needed to be able build, run, and publish with the newest AGP version.

Testing

Unit testing

N/A

Manual testing

Built SDK with Java 17 (Note: do NOT publish with JDK21 yet) and tested publishing with a staging build with:

  • Java 11
  • Gradle 7.3.3
  • APG 7.2.2
  • Android 5 & 14 Emulator
  • Ensure the example app's Huawei flavor builds and runs.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes
  • Build or Publishing

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

jkasten2 added 6 commits March 3, 2025 19:07
Commit just contains the upgrades themselves, a follow up commit will
includes changes required to address their build requirements.
* namespace is now always required
* Some gradle.properties values were completely dropped in APG 8
* Publish release access changed to avoid build error, more changes are need to actually publish.
Since Gradle / AGP 8 upgrade the example doesn't work for
Huawei builds, however this uncovered we were not correctly omitting it
for all tasks.

We will fix Huawei in the example project not building in follow up
commit.
The top level gradle project needs a Java / Kotlin module, otherwise
it skipped publishing an .aar file. While there is no code, projects
consuming this SDK look for it.
  * Maybe we can omit the .aar on in the future for this top level
  project but keeping it working the same for now.

Built SDK with Java 17 and tested publishing with a staging build with:
 * Java 11
 * Gradle 7.3.3
 * APG 7.2.2
 * Android 5 & 14 Emulator

WARNING:
 It is still recommended building with Java 17 instead of 21
 when publishing, as those on older version of R8 will get this
 build error:
 * Cannot invoke "String.length()" because "<parameter1>" is null
 * See https://stackoverflow.com/q/77788162
@jkasten2 jkasten2 requested review from jinliu9508 and nan-li March 4, 2025 02:48
Copy link
Contributor

@jinliu9508 jinliu9508 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build was failed until AGP is upgraded. After Gradle and AGP is upgraded, was able to successfully build and test with Android Build Tools v35, Java 11.

@jkasten2 jkasten2 merged commit f6d4922 into identity_verification_beta Mar 4, 2025
1 of 2 checks passed
@jkasten2 jkasten2 deleted the upgrade/gradle-and-agp-8 branch March 4, 2025 19:23
@jkasten2 jkasten2 mentioned this pull request Mar 4, 2025
18 tasks
@michael-winkler
Copy link

michael-winkler commented Mar 4, 2025

@jkasten2 Fyi:

  • latest gradle version ist 8.9.0
  • latest compileSdkVersion is 35 and not 34

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.

4 participants