Skip to content

Commit 3e00109

Browse files
committed
update gradle versions in build files and apply agp 8 fixes
1 parent 23049d0 commit 3e00109

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

android/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ buildscript {
66
mavenCentral()
77
}
88
dependencies {
9-
classpath "com.android.tools.build:gradle:7.1.2"
9+
// AGP 8.5.1+ aligns uncompressed .so at 16KB automatically
10+
// Requires JDK 17+
11+
classpath "com.android.tools.build:gradle:8.5.1"
1012

1113
// NOTE: Do not place your application dependencies here; they belong
1214
// in the individual module build.gradle files

android/iotdevicesdk/build.gradle

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,30 @@ ext {
4343
}
4444

4545
android {
46-
compileSdkVersion 30
47-
buildToolsVersion "30.0.3"
46+
namespace "software.amazon.awssdk.iotdevicesdk" // REQUIRED on AGP 8+
47+
48+
compileSdkVersion 35
4849

4950
defaultConfig {
5051
minSdkVersion 24
51-
targetSdkVersion 30
52+
targetSdkVersion 33
5253
versionCode = gitVersionCode()
5354
versionName = gitVersionName()
5455
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
5556
consumerProguardFiles 'consumer-rules.pro'
5657
}
5758

59+
buildFeatures {
60+
// AGP 8 disables buildConfig generation by default. We set this to true
61+
// to resstore BuildConfig.VERSION_NAME for both debug and release build types.
62+
buildConfig true
63+
}
64+
65+
// Make the 'release' SoftwareComponent available for publishing on AGP 8
66+
publishing {
67+
singleVariant("release") { withSourcesJar() }
68+
}
69+
5870
sourceSets {
5971
main.java {
6072
srcDirs = ['src/main/java',
@@ -145,7 +157,10 @@ afterEvaluate {
145157

146158
publications {
147159
release(MavenPublication) {
148-
from components.release
160+
def comp = components.findByName("release")
161+
if (comp != null) {
162+
from comp
163+
}
149164

150165
groupId = 'software.amazon.awssdk.iotdevicesdk'
151166
artifactId = 'aws-iot-device-sdk-android'

sdk/tests/android/testapp/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath "com.android.tools.build:gradle:7.1.2"
8+
classpath "com.android.tools.build:gradle:8.5.1"
99
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1010
}
1111
}

0 commit comments

Comments
 (0)