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
[Xamarin.Android.Build.Tasks] error for Android.Support
Context: #8478
Some hardcoded paths/properties in Xamarin.AndroidX.Migration cause
tests failures in #8478 such as:
(_AndroidXCecilfy target) ->
/Users/runner/.nuget/packages/xamarin.androidx.migration/1.0.8/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : Source assembly does not exist: 'obj/Debug/android/assets/UnnamedProject.dll'.
Where `$(MonoAndroidIntermediateAssetsDir)` does not account for a new
architecture in the path:
<ItemGroup>
<_AndroidXFileToCecilfy Include="@(ResolvedUserAssemblies->'$(MonoAndroidIntermediateAssetsDir)%(Filename)%(Extension)')"
Condition="('%(ResolvedUserAssemblies.TargetFrameworkIdentifier)' == 'MonoAndroid' or '%(ResolvedUserAssemblies.HasMonoAndroidReference)' == 'true') and ('%(ResolvedUserAssemblies.AndroidXSkipAndroidXMigration)' != 'true')" />
</ItemGroup>
We don't really *support* the old Android.Support libraries or
AndroidX.Migration, but we don't have any build warnings or errors in
place for this.
Introduce a `XA1039` error in .NET 9 if any packages are found matching:
* `Xamarin.Android.Support.*`
* `Xamarin.Android.Arch.*`
The biggest impact here is going to be many of our old tests, which
use the support libraries in various forms.
Improvements & general cleanup:
* Removed all old/unused packages in `KnownPackages.cs`
* Updated `KnownPackages.cs` to latest versions, including Xamarin.Forms
* Android Wear tests are now migrated from support to AndroidX:
https://android-developers.googleblog.com/2016/04/build-beautifully-for-android-wear.html
* `CheckEmbeddedSupportLibraryResources` -> moved to AndroidX
* `BuildHasNoWarnings` was not appropriately applying `IsRelease`.
* `Android.Support.v8.RenderScript` removed in favor of inline `.so` file.
* A few tests that used support libraries to create a project large
numbers of dependencies, moved to `XamarinFormsAndroidApplicationProject`.
* `ResolveLibraryProjectImports` -> sorted comparisions
* `XamarinFormsAndroidApplicationProject` has a workaround for Guava:
dotnet/android-libraries#535
Removed tests:
* `AndroidXMigration`, `AndroidXMigrationBug`
* `ResolveLibraryImportsWithReadonlyFiles`, seemed duplicate of other
Android Wear tests, and used support libraries.
* `ExtraAaptManifest` as it depends on `Xamarin.Android.Fabric` and
`Xamarin.Android.Crashlytics`. These are deprecated and depend on
support libraries.
* `BuildProguardEnabledProjectSource` now only tests `Release` mode.
Since updating to AndroidX, `Debug` mode was triggering multi-dex.
Making it difficult to assert contents of `*.dex` files.
In a future PR, we will backport these changes, but downgrade the error
to a warning:
--<AndroidError Code="XA1039"
++<AndroidWarning Code="XA1039"
ResourceName="XA1039"
FormatArguments="9"
Condition=" '@(_AndroidUnsupportedPackages->Count())' != '0' "
/>
error XA1039: The Android Support libraries are not longer supported in .NET 9, please migrate to AndroidX. See https://aka.ms/xamarin/androidx for more details.
12
+
```
13
+
14
+
## Issue
15
+
16
+
Outdated "Android Support Library" packages are no longer supported in .NET 9:
17
+
18
+
*`Xamarin.Android.Arch.*`
19
+
*`Xamarin.Android.Support.*`
20
+
21
+
The underlying Java libraries are no longer supported by Google since the final
22
+
28.0.0 release. See the [Android Support Library Documentation][support] for
23
+
details.
24
+
25
+
Some example prefixes of the newer, supported AndroidX packages are:
26
+
27
+
*`Xamarin.AndroidX.*`
28
+
*`Xamarin.AndroidX.Arch.*`
29
+
30
+
For more information about the Android Support libraries or AndroidX, see:
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1006,4 +1006,9 @@ To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MS
1006
1006
{0} - The deprecated MSBuild property name
1007
1007
{1} - The numeric version of .NET</comment>
1008
1008
</data>
1009
+
<dataname="XA1039"xml:space="preserve">
1010
+
<value>The Android Support libraries are no longer supported in .NET {0}, please migrate to AndroidX. See https://aka.ms/xamarin/androidx for more details.</value>
1011
+
<comment>The following are literal names and should not be translated: Android Support, AndroidX, .NET.
@@ -202,41 +200,6 @@ public void BuildLibraryZipBindigLibraryWithAarOfJar (string classParser)
202
200
<attr path=""/api/package[@name='com.ipaulpro.afilechooser']/class[@name='FileListAdapter']/method[@name='getItem' and count(parameter)=1 and parameter[1][@type='int']]"" name=""managedReturn"">Java.Lang.Object</attr>
203
201
<attr path=""/api/package[@name='com.ipaulpro.afilechooser']/class[@name='FileLoader']/method[@name='loadInBackground' and count(parameter)=0]"" name=""managedName"">LoadInBackgroundImpl</attr>
Assert.IsTrue(manifest.Contains($"android:authorities=\"{proj.PackageName}.crashlyticsinitprovider\""),"placeholder not replaced");
464
-
Assert.IsFalse(manifest.Contains("dollar_openBracket_applicationId_closeBracket"),"`aapt/AndroidManifest.xml` not ignored");
465
-
}
466
-
}
467
-
468
436
[Test]
469
437
publicvoidAarContentExtraction()
470
438
{
@@ -714,7 +682,10 @@ public void BuildAfterUpgradingNuget ()
714
682
varproj=newXamarinAndroidApplicationProject();
715
683
proj.MainActivity=proj.DefaultMainActivity.Replace("public class MainActivity : Activity","public class MainActivity : AndroidX.AppCompat.App.AppCompatActivity");
0 commit comments