From 7ccd6ed5c173fcbba013117fcf9771df5b0e2722 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 23 May 2024 21:48:04 +0200 Subject: [PATCH 1/5] android: bump minSdkVersion to 21 Fixes the following error with AGP 8.4: A problem occurred configuring project ':webcrypto'. > [CXX1110] Platform version 16 is unsupported by this NDK. Please change minSdk to at least 21 to avoid undefined behavior. To suppress this error, add android.ndk.suppressMinSdkVersionError=21 to the project's gradle.properties or set android.experimentalProperties["android.ndk.suppressMinSdkVersionError"]=21 in the Gradle build file. --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index f28ee5fb..cd1c9308 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -53,7 +53,7 @@ android { } defaultConfig { - minSdkVersion 16 + minSdkVersion 21 ndk { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' } From 4d147b3cd82bfb4a95c8f60ccb660a4f79648e55 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 23 May 2024 21:48:56 +0200 Subject: [PATCH 2/5] android: drop package attribute from AndroidManifest.xml Fixes the following error with AGP 8.4: Execution failed for task ':webcrypto:processReleaseManifest'. > A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction > Incorrect package="com.example.webcrypto" found in source AndroidManifest.xml: /home/simon/src/webcrypto.dart/android/src/main/AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="com.example.webcrypto" from the source AndroidManifest.xml: /home/simon/src/webcrypto.dart/android/src/main/AndroidManifest.xml. --- android/build.gradle | 5 +---- android/src/main/AndroidManifest.xml | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index cd1c9308..615844ce 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -25,10 +25,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'dev.google.webcrypto' - } + namespace 'dev.google.webcrypto' compileSdkVersion 31 diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 06c43a03..4438c79a 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -14,6 +14,5 @@ limitations under the License. --> - + From 51e276cf3dba334e13faf55588f7f5add81fcfd2 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 12 Jun 2024 21:55:38 +0200 Subject: [PATCH 3/5] example: build.gradle automatic upgrade These changes are made automatically by the flutter tool when running "flutter build apk". --- example/android/app/build.gradle | 2 +- example/android/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 856a1cd5..9e2fcc85 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -45,7 +45,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.webcrypto_example" - minSdkVersion 16 + minSdkVersion flutter.minSdkVersion targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/example/android/build.gradle b/example/android/build.gradle index 83ae2200..3cdaac95 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } From fa1a9a5700c4201d2c961d9ffa24bed23cecf1b9 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 12 Jun 2024 21:58:02 +0200 Subject: [PATCH 4/5] example: upgrade to AGP 8.4 This is done via the Android Studio AGP upgrade assistant. --- example/android/app/build.gradle | 1 + example/android/app/src/debug/AndroidManifest.xml | 3 +-- example/android/app/src/main/AndroidManifest.xml | 3 +-- example/android/app/src/profile/AndroidManifest.xml | 3 +-- example/android/build.gradle | 4 ++-- example/android/gradle.properties | 3 +++ example/android/gradle/wrapper/gradle-wrapper.properties | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 9e2fcc85..0a9de12b 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -58,6 +58,7 @@ android { signingConfig signingConfigs.debug } } + namespace 'com.example.webcrypto_example' } flutter { diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index 805c372c..9cadc7e1 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -14,8 +14,7 @@ limitations under the License. --> - + - + - +