adobe / adobe/aepsdk_flutter

[Android] Missing compileOptions causes "source/target value 8 is obsolete" warnings with newer AGP

Open Beginner friendly
#176 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
12
Forks
21
PR merge metrics
No merged PRs in 30d

Description

## Description

The `android/build.gradle` file in `flutter_aepedgeconsent` (and likely other plugins in this monorepo)
does not define `compileOptions`, causing the Java compiler to fall back to the default Java 8 target.
With newer versions of AGP (8.x+) and JDK 17+, this produces the following warnings during build:

warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.

## Environment

- flutter_aepedgeconsent: 4.0.2 (also reproduced with 5.0.0)
- Flutter: 3.47.0
- AGP: 8.11.1
- Gradle: 8.14
- JDK: 17

## Expected behavior

No Java compilation warnings related to source/target compatibility.

## Suggested fix

Add `compileOptions` to `android/build.gradle`:

```groovy
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}
```
This aligns with the Java compiler (javac) deprecation of `--source 8` and `--target 8` introduced in JDK 17, and is expected to become an error in future JDK versions.

Contributor guide

Open the contributing guide

Research direction

Start with android/build.gradle in flutter_aepedgeconsent and inspect the corresponding Android build files for other plugins in the monorepo. Run an Android build with the reported AGP, Gradle, and JDK versions, then verify that the Java source/target compatibility warnings no longer appear.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, flutter, java
Domain
build-system, mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.