-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for AGP 8.4 #120
Conversation
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.
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.
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 |
Hmm, I'm guessing we should also look at: I'll file it separately, as #124 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
// Conditional for compatibility with AGP <4.2. | ||
if (project.android.hasProperty("namespace")) { | ||
namespace 'dev.google.webcrypto' | ||
} | ||
namespace 'dev.google.webcrypto' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dumb question, but do we not need this anymore?
Will minSdkVersion 21
make AGP < 4.2 irrelevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AGP 8.4 rejects AndroidManifest.xml
files with a package
attribute. If we only set the namespace for AGP ≥ 4.2, then on AGP < 4.2 we won't define any namespace at all and the build will fail anyways.
I think it's reasonable to ask library users to upgrade AGP ≥ 4.2 when upgrading webcrypto.dart.
@emersion can you please let me know how to reproduce this error |
These changes are made automatically by the flutter tool when running "flutter build apk".
This is done via the Android Studio AGP upgrade assistant.
Correct. Note that the latest version of Flutter requires Android ≥ 5.x, so this just aligns the plugin requirements with Flutter's.
Yes, that would be nice to fix as well. But it's orthogonal.
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. |
Java 11 is not new enough for AGP 8.4.
Fixes the following errors with AGP 8.4:
and