-
Notifications
You must be signed in to change notification settings - Fork 533
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
[Xamarin.Android.Build.Tasks] remove the code that XA0121 deprecates #3857
Conversation
ee19f6b
to
7c4284d
Compare
@garuma with the changes here, the MyDriving app won't build anymore unless the NuGet packages are updated. Is that worth it, or do you think it could be dropped from the Designer's tests? Their repo is readonly now: https://github.com/Azure-Samples/MyDriving |
I started a build on a public branch: https://build.azdo.io/3211313 To see how our regression tests fare, I suspect I will need to update lots of projects 😨 |
@jonathanpeppers hmmm, ideally I would want to keep the project (doing the updates that are needed) as it usually tends to uncover a lot of good regression with those style of older projects, should we try to fork the repo and work and making it compliant with this change? |
@garuma do you have a fork already with some changes? You have this change somewhere for aapt2: Azure-Samples/MyDriving#607 There might be other changes, too, I vaguely remember some. |
7c4284d
to
974bb51
Compare
Context: dotnet#3654 Context: https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.1#xa0121-deprecation-warning-for-old-xamarinandroidsupport-library-versions In VS 16.4 / Xamarin.Android 10.1, we deprecated `<GetAdditionalResourcesFromAssemblies/>`. This PR removes the behavior completely for 16.5, since it uses SHA1. We aim to remove all SHA1 and MD5 usage for 16.5. NuGet packages I've seen that no longer work: * Android Support Libraries, 25.x and older * Google Play Services older than 44.x I have still been able to use an old Xamarin.Forms (2.3.4) in combination with newer support libraries. ~~ XA0121 is now an error ~~ We give a build error now in `<FilterAssemblies/>` if we encounter the unsupported attributes. This target runs very early in the build, so we have to do it at this point. ~~ JcwGen-Tests ~~ These tests were using these attributes such as: [assembly: Android.IncludeAndroidResourcesFromAttribute ("./", SourceUrl="file:///JavaLib.zip")] [assembly: Java.Interop.JavaLibraryReference ("classes.jar", SourceUrl="file:///JavaLib.zip")] [assembly: Android.NativeLibraryReference ("arm64-v8a/libsimple.so", SourceUrl="file:///NativeLib.zip", Version="native-lib-1")] Instead, I switched to use `@(LibraryProjectZip)` for the `.aar` file and `@(EmbeddedNativeLibrary)` for the `.so` files. ~~ Designer Tests ~~ The designer tests build the MyDriving app: https://github.com/Azure-Samples/MyDriving Which uses old NuGet packages that now fail, and is now in read-only mode on Github. I suspect we may just need to remove that test? error XA0121: Assembly 'Xamarin.Android.Support.CustomTabs' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.
974bb51
to
14922d9
Compare
@@ -1534,25 +1534,6 @@ public void BuildApplicationCheckThatAddStaticResourcesTargetDoesNotRerun () | |||
} | |||
} | |||
|
|||
[Test] | |||
[Ignore ("Re enable when MergeResources work is complete")] |
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.
Future work. Let's remove all of the tests labeled with this. As well as the code for the managed resource merger. I think we are just going to use the google tooling (aapt2) going forward.
// Clean the Resource Cache. | ||
if (!TestEnvironment.IsRunningOnCI) | ||
return; | ||
if (Directory.Exists (CachePath)) { |
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.
This brings up an interesting thought. Should we be deleting this Cache for the user? or issue a warning that they can now remove this directory? It might be taking up valuable space.
Its probably something for the release notes I think.
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.
Yes, we should probably document on the next release notes for 10.2 that will expand upon: https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.1#xa0121-deprecation-warning-for-old-xamarinandroidsupport-library-versions
I don't know about automatically deleting/warning about it, though. You can install VS side-by-side on Windows, and they could have 2017, etc.
…3857) Context: #3654 Context: https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.1#xa0121-deprecation-warning-for-old-xamarinandroidsupport-library-versions In VS 16.4 / Xamarin.Android 10.1, we deprecated `<GetAdditionalResourcesFromAssemblies/>`. This PR removes the behavior completely for 16.5, since it uses SHA1. We aim to remove all SHA1 and MD5 usage for 16.5. NuGet packages I've seen that no longer work: * Android Support Libraries, 25.x and older * Google Play Services older than 44.x I have still been able to use an old Xamarin.Forms (2.3.4) in combination with newer support libraries. ~~ XA0121 is now an error ~~ We give a build error now in `<FilterAssemblies/>` if we encounter the unsupported attributes. This target runs very early in the build, so we have to do it at this point. ~~ JcwGen-Tests ~~ These tests were using these attributes such as: [assembly: Android.IncludeAndroidResourcesFromAttribute ("./", SourceUrl="file:///JavaLib.zip")] [assembly: Java.Interop.JavaLibraryReference ("classes.jar", SourceUrl="file:///JavaLib.zip")] [assembly: Android.NativeLibraryReference ("arm64-v8a/libsimple.so", SourceUrl="file:///NativeLib.zip", Version="native-lib-1")] Instead, I switched to use `@(LibraryProjectZip)` for the `.aar` file and `@(EmbeddedNativeLibrary)` for the `.so` files. ~~ Designer Tests ~~ The designer tests build the MyDriving app: https://github.com/Azure-Samples/MyDriving Which uses old NuGet packages that now fail, and is now in read-only mode on Github. I suspect we may just need to remove that test? error XA0121: Assembly 'Xamarin.Android.Support.CustomTabs' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.
Context: #3654
Context: https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.1#xa0121-deprecation-warning-for-old-xamarinandroidsupport-library-versions
In VS 16.4 / Xamarin.Android 10.1, we deprecated
<GetAdditionalResourcesFromAssemblies/>
.This PR removes the behavior completely for 16.5, since it uses SHA1.
We aim to remove all SHA1 and MD5 usage for 16.5.
NuGet packages I've seen that no longer work:
I have still been able to use an old Xamarin.Forms (2.3.4) in
combination with newer support libraries.
XA0121 is now an error
We give a build error now in
<FilterAssemblies/>
if we encounter theunsupported attributes. This target runs very early in the build, so
we have to do it at this point.
JcwGen-Tests
These tests were using these attributes such as:
Instead, I switched to use
@(LibraryProjectZip)
for the.aar
fileand
@(EmbeddedNativeLibrary)
for the.so
files.Designer Tests
The designer tests build the MyDriving app:
https://github.com/Azure-Samples/MyDriving
Which uses old NuGet packages that now fail, and is now in read-only
mode on Github. I suspect we may just need to remove that test?