Skip to content

Commit 5b5391f

Browse files
committed
fix(acij): make the android module compatible with AGP 8
1 parent 1497592 commit 5b5391f

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

packages/amazon-cognito-identity-js/android/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import com.android.Version
2+
3+
def agpVersion = Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
4+
def androidManifestPath = agpVersion >= 7 ? 'src/main/AndroidManifest.xml' : 'src/hasNamespace/AndroidManifest.xml'
5+
16
buildscript {
27
repositories {
38
mavenCentral()
@@ -15,6 +20,10 @@ def safeExtGet(prop, fallback) {
1520
}
1621

1722
android {
23+
if (agpVersion >= 7) {
24+
namespace "com.amazonaws"
25+
}
26+
1827
compileSdkVersion safeExtGet('compileSdkVersion', 26)
1928
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
2029

@@ -24,6 +33,11 @@ android {
2433
versionCode 1
2534
versionName "1.0"
2635
}
36+
sourceSets {
37+
main {
38+
manifest.srcFile androidManifestPath
39+
}
40+
}
2741
lintOptions {
2842
abortOnError false
2943
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.amazonaws">
3+
4+
</manifest>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.amazonaws">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32

43
</manifest>

0 commit comments

Comments
 (0)