You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve Android SDK and NDK mistmatch warning message (flutter#147809)
This PR resolvesflutter#147806
- List plugin that want to be compiled against a higher Android SDK version
- List plugins that depend on a different NDK version (we don't have a way to compare them)
- Small formatting and wording improvements
- Update syntax to work for both Groovy and Kotlin
- If project uses `build.gradle.kts`, then it is mentioned in the warning message (previously always `build.gradle` was mentioned)
<img width="1209" alt="demo" src="https://github.com/flutter/flutter/assets/40357511/be3522b5-d1b4-4983-9fed-8aaa0f0bc7f7">
if (maxPluginCompileSdkVersion > projectCompileSdkVersion) {
861
-
project.logger.error("One or more plugins require a higher Android SDK version.\nFix this issue by adding the following to ${project.projectDir}${File.separator}build.gradle:\nandroid {\n compileSdkVersion ${maxPluginCompileSdkVersion}\n ...\n}\n")
882
+
project.logger.error("Your project is configured to compile against Android SDK $projectCompileSdkVersion, but the following plugin(s) require to be compiled against a higher Android SDK version:")
883
+
for (Tuple2<String, String>pluginToCompileSdkVersion : pluginsWithHigherSdkVersion) {
884
+
project.logger.error("- ${pluginToCompileSdkVersion.first} compiles against Android SDK ${pluginToCompileSdkVersion.second}")
885
+
}
886
+
project.logger.error("""\
887
+
Fix this issue by compiling against the highest Android SDK version (they are backward compatible).
888
+
Add the following to ${buildGradleFile(project).path}:
889
+
890
+
android {
891
+
compileSdk = ${maxPluginCompileSdkVersion}
892
+
...
893
+
}
894
+
""".stripIndent())
862
895
}
863
896
if (maxPluginNdkVersion != projectNdkVersion) {
864
-
project.logger.error("One or more plugins require a higher Android NDK version.\nFix this issue by adding the following to ${project.projectDir}${File.separator}build.gradle:\nandroid {\n ndkVersion \"${maxPluginNdkVersion}\"\n ...\n}\n")
897
+
project.logger.error("Your project is configured with Android NDK $projectNdkVersion, but the following plugin(s) depend on a different Android NDK version:")
898
+
for (Tuple2<String, String>pluginToNdkVersion : pluginsWithDifferentNdkVersion) {
0 commit comments