From 9f09eeacfde08d7c190725cd8af4ae6fcdf4c2f1 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 00:41:00 +0000 Subject: [PATCH 1/4] Update LaunchDarkly Android Client SDK to 5.11.0 Updates the launchdarkly-android-client-sdk dependency from 4.2.2 to 5.11.0, the latest release of the LaunchDarkly Android Client SDK. Co-Authored-By: rlamb@launchdarkly.com --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index ac4ee86..ea8ff50 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,5 +23,5 @@ android { dependencies { implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.launchdarkly:launchdarkly-android-client-sdk:4.2.2' + implementation 'com.launchdarkly:launchdarkly-android-client-sdk:5.11.0' } From 45897afe9613e4dc2071fc4bb85421999fff2b66 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 21:49:13 +0000 Subject: [PATCH 2/4] Upgrade build tooling for SDK 5.11.0 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SDK 5.11.0 requires newer build tooling. Updates: - AGP: 4.1.3 → 8.7.0 (migrated from buildscript to plugins DSL) - Gradle wrapper: 6.7 → 8.9 - compileSdk/targetSdk: 33 → 34 - minSdk: 21 → 24 - Added pluginManagement and dependencyResolutionManagement to settings.gradle - Moved namespace from AndroidManifest.xml to build.gradle (AGP 8.x requirement) Co-Authored-By: rlamb@launchdarkly.com --- app/build.gradle | 11 ++++++---- app/src/main/AndroidManifest.xml | 5 ++--- build.gradle | 28 ++---------------------- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 18 +++++++++++++++ 5 files changed, 30 insertions(+), 34 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ea8ff50..dc2958b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.application' +plugins { + id 'com.android.application' +} android { - compileSdkVersion(33) + namespace "com.launchdarkly.hello_android" + compileSdk 34 defaultConfig { applicationId "com.launchdarkly.hello_android" - minSdkVersion(21) - targetSdkVersion(33) + minSdkVersion(24) + targetSdkVersion(34) versionCode 1 versionName "1.0" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3e9fb21..760d71d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + - \ No newline at end of file + diff --git a/build.gradle b/build.gradle index 9f4fade..5e9cadd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,28 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:4.1.3' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenLocal() - // Before LaunchDarkly release artifacts get synced to Maven Central they are here along with snapshots: - maven { url = uri("https://oss.sonatype.org/content/groups/public/") } - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir +plugins { + id 'com.android.application' version '8.7.0' apply false } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 28eec68..94bfeb9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip diff --git a/settings.gradle b/settings.gradle index e7b4def..4850079 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,19 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + mavenLocal() + // Before LaunchDarkly release artifacts get synced to Maven Central they are here along with snapshots: + maven { url = uri("https://oss.sonatype.org/content/groups/public/") } + } +} +rootProject.name = "hello-android-java" include ':app' From 428166cb4d1b7fc7b76f4a13f33e94478590a35f Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 18:35:51 +0000 Subject: [PATCH 3/4] Update Java version to 17 for AGP 8.7.0 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AGP 8.7.0 requires Java 17 to run. Updates: - CI workflows: java-version 11 → 17 - compileOptions: VERSION_1_8 → VERSION_17 Co-Authored-By: rlamb@launchdarkly.com --- .github/workflows/build.yml | 2 +- .github/workflows/run.yml | 2 +- app/build.gradle | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57bd914..4862042 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: distribution: temurin - java-version: 11 + java-version: 17 cache: 'gradle' - name: Grant execute permission for gradlew diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index fb4ce39..c905b9b 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -41,7 +41,7 @@ jobs: uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: distribution: temurin - java-version: 11 + java-version: 17 cache: 'gradle' - name: Grant execute permission for gradlew diff --git a/app/build.gradle b/app/build.gradle index dc2958b..e557668 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,8 +19,8 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } } From 4de02edbff582da1c874d61250a4bb762121759e Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 18:37:55 +0000 Subject: [PATCH 4/4] Fix LDConfig.Builder API for SDK 5.x (requires AutoEnvAttributes) SDK 5.x changed LDConfig.Builder to require an AutoEnvAttributes parameter. Updated to use AutoEnvAttributes.Enabled, matching the hello-android Kotlin example. Co-Authored-By: rlamb@launchdarkly.com --- .../java/com/launchdarkly/hello_android/MainApplication.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/launchdarkly/hello_android/MainApplication.java b/app/src/main/java/com/launchdarkly/hello_android/MainApplication.java index 1119ed8..8bdb5f5 100644 --- a/app/src/main/java/com/launchdarkly/hello_android/MainApplication.java +++ b/app/src/main/java/com/launchdarkly/hello_android/MainApplication.java @@ -6,6 +6,7 @@ import com.launchdarkly.sdk.LDContext; import com.launchdarkly.sdk.android.LDClient; import com.launchdarkly.sdk.android.LDConfig; +import com.launchdarkly.sdk.android.LDConfig.Builder.AutoEnvAttributes; public class MainApplication extends Application { @@ -18,7 +19,9 @@ public void onCreate() { // Set LAUNCHDARKLY_MOBILE_KEY to your LaunchDarkly mobile key found on the LaunchDarkly // dashboard in the start guide. - LDConfig ldConfig = new LDConfig.Builder() + // If you want to disable the Auto EnvironmentAttributes functionality, + // use AutoEnvAttributes.Disabled as the argument to the Builder. + LDConfig ldConfig = new LDConfig.Builder(AutoEnvAttributes.Enabled) .mobileKey(LAUNCHDARKLY_MOBILE_KEY) .build();