Skip to content

Commit aa73a7f

Browse files
dellis1972jonpryor
authored andcommitted
[Xamarin.Android.Build.Tasks] Add XA0117 warning (#2250)
Add a new XA0117 warning which will inform users if they are using a `$(TargetFrameworkVersion)` value which will be deprecated "soon". In our next version our minimum supported `$(TargetFrameworkVersion)` will be v4.4 (API-19), and support for v2.3 (API-10) will be removed.
1 parent 14d91c3 commit aa73a7f

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

Documentation/guides/messages/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
+ [XA0113](xa0113.md): Google Play requires that new applications must use a `$(TargetFrameworkVersion)` of v8.0 (API level 26) or above.
4242
+ [XA0114](xa0114.md): Google Play requires that application updates must use a `$(TargetFrameworkVersion)` of v8.0 (API level 26) or above.
4343
+ [XA0115](xa0115.md): Invalid value 'armeabi' in $(AndroidSupportedAbis). This ABI is no longer supported. Please update your project properties.
44+
+ [XA0116](xa0116.md): Unable to find `EmbeddedResource` of name `{ResourceName}`.
45+
+ [XA0117](xa0117.md): The TargetFrameworkVersion {TargetFrameworkVersion} is deprecated. Please update it to be v4.4 or higher.
4446

4547
### XA1xxx Project Related
4648

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Compiler Warning XA0117
2+
3+
As the Android platform evolves certain versions will be deprecated and
4+
removed. How we decide if a platform is deprecated largely depends on whether
5+
the [Android NDK][ndk] continues to support the platform in question.
6+
It also depends on whether the
7+
[Android Support Libraries support that platform][support].
8+
9+
If both the Android NDK and the Android Support Libraries have removed support
10+
for a particular `apiLevel`, then it is highly likely that support for the
11+
API level will be deprecated and removed from Xamarin.Android.
12+
13+
If you are seeing this warning it is because your `$(TargetFrameworkVersion)`
14+
is set to a value which is likely to be deprecated in the near future.
15+
To remove this warning update your `$(TargetFrameworkVersion)` to use
16+
the latest stable platform.
17+
18+
Your `android:minSdk` value within `AndroidManifest.xml` can still mention
19+
older versions of the android platform.
20+
21+
22+
[ndk]: https://developer.android.com/ndk/downloads/revision_history
23+
[support]: https://developer.android.com/distribute/best-practices/develop/target-sdk
24+
25+

src/Xamarin.Android.Build.Tasks/Tasks/ResolveAndroidTooling.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ public override bool Execute ()
190190
Log.LogCodedWarning ("XA0113", $"Google Play requires that new applications must use a TargetFrameworkVersion of v8.0 (API level 26) or above. You are currently targeting {TargetFrameworkVersion} (API level {AndroidApiLevel}).");
191191
if (apiLevel < 26)
192192
Log.LogCodedWarning ("XA0114", $"Google Play requires that application updates must use a TargetFrameworkVersion of v8.0 (API level 26) or above. You are currently targeting {TargetFrameworkVersion} (API level {AndroidApiLevel}).");
193+
if (apiLevel < 19)
194+
Log.LogCodedWarning ("XA0117", $"The TargetFrameworkVersion {TargetFrameworkVersion} is deprecated. Please update it to be v4.4 or higher.");
193195
}
194196

195197
SequencePointsMode mode;

0 commit comments

Comments
 (0)