google / webcrypto.dart

Cross-platform implementation of Web Cryptography APIs
https://pub.dev/packages/webcrypto
Apache License 2.0
71 stars 43 forks source link

Add support for AGP 8.4 #120

Closed emersion closed 1 week ago

emersion commented 1 month ago

Fixes the following errors 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.

and

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.
jonasfj commented 1 month ago

Do I understand it correctly that this will drop support for Android 4.x, which is more than 12 years old at this point.

That might be acceptable, I'm guessing :D

jonasfj commented 1 month ago

Hmm, I'm guessing we should also look at: https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply

I'll file it separately, as https://github.com/google/webcrypto.dart/issues/124

HamdaanAliQuatil commented 1 month ago

Fixes the following errors 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.

and

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.

@emersion can you please let me know how to reproduce this error

emersion commented 2 weeks ago

Do I understand it correctly that this will drop support for Android 4.x, which is more than 12 years old at this point.

Correct. Note that the latest version of Flutter requires Android ≥ 5.x, so this just aligns the plugin requirements with Flutter's.

Hmm, I'm guessing we should also look at: https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply

Yes, that would be nice to fix as well. But it's orthogonal.

Is there some kind of testing we should do to be more confident this is correct?

I'd love to have it covered in CI.

I've pushed a commit to upgrade the example to AGP 8.4. The failures reported in the first two commits can be reproduced there.