You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update LaunchDarkly Android Client SDK to 5.11.0 (#5)
## Summary
Bumps `launchdarkly-android-client-sdk` from **4.2.2** to **5.11.0** — a
**major version upgrade** (4.x → 5.x).
SDK 5.11.0 requires newer build tooling than what the project previously
used (AGP 4.1.3 / Gradle 6.7). The build configuration has been
modernized to match, and application code was updated for SDK 5.x API
changes.
### Changes
Upgraded the entire build toolchain for SDK 5.11.0 compatibility:
| Component | Before | After |
|-----------|--------|-------|
| AGP | 4.1.3 | 8.7.0 |
| Gradle wrapper | 6.7 | 8.9 |
| compileSdk / targetSdk | 33 | 34 |
| minSdk | 21 | 24 |
| Java (compileOptions) | 1.8 | 17 |
| CI java-version | 11 (newly added) | 17 |
Structural changes:
- Migrated `build.gradle` from legacy `buildscript`/`allprojects` DSL to
modern `plugins` DSL
- Added `pluginManagement` and `dependencyResolutionManagement` blocks
to `settings.gradle`
- Moved `namespace` from `AndroidManifest.xml` `package` attribute to
`app/build.gradle` (required by AGP 8.x)
- Updated CI workflows (`build.yml`, `run.yml`) from Java 11 to Java 17
— AGP 8.7.0 requires Java 17 to run
SDK 5.x API migration in `MainApplication.java`:
- `LDConfig.Builder()` → `LDConfig.Builder(AutoEnvAttributes.Enabled)`
(required parameter added in 5.x)
- Added import for
`com.launchdarkly.sdk.android.LDConfig.Builder.AutoEnvAttributes`
## Review & Testing Checklist for Human
- [ ] **Check for additional breaking API changes in the v4 → v5
migration.** One breaking change was found and fixed (`LDConfig.Builder`
now requires `AutoEnvAttributes`), but there may be others. The app also
uses `LDClient.get()`, `LDClient.init()`, `boolVariation()`,
`registerFeatureFlagListener()`, `flush()`, and `LaunchDarklyException`
— verify these haven't changed signatures or behavior. Check the [SDK
changelog / migration
guide](https://github.com/launchdarkly/android-client-sdk).
- [ ] **Verify `minSdk 24` is actually required.** This was bumped from
21 — confirm whether SDK 5.x truly requires API 24+. If not, revert to
21 to avoid dropping Android 5.0–6.x device support unnecessarily.
- [ ] **Run the app on an emulator or device** with a valid mobile key
and confirm flag evaluation works end-to-end. CI now includes an
emulator run, but given the scope of changes (major SDK bump + full
build tooling overhaul + source code changes), a manual sanity check is
recommended.
- [ ] **Verify Java 17 compileOptions are appropriate.** Changed from
`VERSION_1_8` to `VERSION_17` to match the AGP 8.x toolchain. Confirm
this doesn't break runtime compatibility on target devices.
**Suggested test plan:** Open the project in Android Studio, verify
Gradle sync succeeds, build the debug APK, run on an emulator with a
valid mobile key, and confirm the SDK initializes and evaluates a flag
correctly.
### Notes
- CI was added to this repo by the reviewer during this PR. The initial
workflows used Java 11, which is incompatible with AGP 8.7.0 (requires
Java 17). This was fixed in a subsequent commit.
- The `AutoEnvAttributes.Enabled` usage mirrors the [hello-android
(Kotlin) example](https://github.com/launchdarkly/hello-android), whose
equivalent PR was already merged.
- This change was **not tested locally** — no Android build toolchain
was available in the build environment. Human verification is strongly
recommended.
- Requested by: rlamb@launchdarkly.com
- [Devin
Session](https://app.devin.ai/sessions/ee3f83c0a9d74a3f8320d35e0763e498)
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: rlamb@launchdarkly.com <rlamb@launchdarkly.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
0 commit comments