Skip to content
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

Upgrade to Uno 3.x, minor control changes required #167

Closed
wants to merge 2 commits into from

Conversation

mitchcapper
Copy link

@mitchcapper mitchcapper commented Sep 23, 2020

Switched to Uno 3.x. Using an Uno 2.x control in an Uno 3.x project can cause odd crash exceptions. Officially they say 3.x is soruce compat with 2.x so people shouldn't have an issue upgrading but clearly there can be minor differences.

Issues Resolved

fixes #375

API Changes

None

Platforms Affected

Core

Behavioral/Visual Changes

This moves users to uno 3.x so while there are no libvlcsharp changes there are some minor upgrade notes:
https://github.com/unoplatform/uno/blob/master/doc/articles/migrating-from-previous-releases.md
One tooltip had to migrate from content presenter to content control however I don't believe it should cause an issue. This is due to CP now allowing to have a content property bound to a non template item.

Before/After Screenshots

No UI changes.

Testing Procedure

Tested Android and UWP no ios device.

PR Checklist

  • [X ] Rebased on top of the target branch at time of PR
  • [ X] Changes adhere to coding standard

relevant links:

@mfkl
Copy link
Member

mfkl commented Sep 24, 2020

Hi,

Thanks for the PR!

It seems the CI is complaining about this:

2020-09-23T16:33:52.2081909Z "D:\a\1\s\src\LibVLCSharp.sln" (Build target) (1) ->
2020-09-23T16:33:52.2082790Z "D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj" (default target) (30) ->
2020-09-23T16:33:52.2084246Z "D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj" (Build target) (30:6) ->
2020-09-23T16:33:52.2086410Z   obj\Release\monoandroid81\g\XamlCodeGenerator\VideoView_Android_iOS_0654003b6e8285e8171ea5eceba6aa4a.g.cs(118,4): error CS0029: Cannot implicitly convert type 'Windows.UI.Xaml.Controls.Border' to 'Android.Views.View' [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2094712Z   obj\Release\monoandroid81\g\XamlCodeGenerator\MediaPlayerElement_44b984361be691e5a697b2e5e83c7ee0.g.cs(118,4): error CS0029: Cannot implicitly convert type 'Windows.UI.Xaml.Controls.Grid' to 'Android.Views.View' [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2097583Z   VideoView.Android.cs(17,71): error CS0103: The name 'ContextHelper' does not exist in the current context [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2101171Z   VideoView.Android.cs(18,21): error CS1061: 'Border' does not contain a definition for 'AddChild' and no accessible extension method 'AddChild' accepting a first argument of type 'Border' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2103330Z   obj\Release\monoandroid81\g\XamlCodeGenerator\VideoView_Android_iOS_0654003b6e8285e8171ea5eceba6aa4a.g.cs(64,76): error CS0029: Cannot implicitly convert type 'Android.Views.View' to 'Windows.UI.Xaml.UIElement' [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2105482Z   obj\Release\monoandroid81\g\XamlCodeGenerator\VideoView_Android_iOS_0654003b6e8285e8171ea5eceba6aa4a.g.cs(64,76): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2108900Z   obj\Release\monoandroid81\g\XamlCodeGenerator\PlaybackControls_a640c024b4ec96fcd73a42d435df6be4.g.cs(69,76): error CS0029: Cannot implicitly convert type 'Android.Views.View' to 'Windows.UI.Xaml.UIElement' [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2111046Z   obj\Release\monoandroid81\g\XamlCodeGenerator\PlaybackControls_a640c024b4ec96fcd73a42d435df6be4.g.cs(69,76): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2113242Z   obj\Release\monoandroid81\g\XamlCodeGenerator\MediaPlayerElement_44b984361be691e5a697b2e5e83c7ee0.g.cs(64,76): error CS0029: Cannot implicitly convert type 'Android.Views.View' to 'Windows.UI.Xaml.UIElement' [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2115519Z   obj\Release\monoandroid81\g\XamlCodeGenerator\MediaPlayerElement_44b984361be691e5a697b2e5e83c7ee0.g.cs(64,76): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2118689Z   obj\Release\monoandroid81\g\XamlCodeGenerator\PlaybackControls_a640c024b4ec96fcd73a42d435df6be4.g.cs(219,74): error CS0029: Cannot implicitly convert type 'Android.Views.View' to 'Windows.UI.Xaml.UIElement' [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2120944Z   obj\Release\monoandroid81\g\XamlCodeGenerator\PlaybackControls_a640c024b4ec96fcd73a42d435df6be4.g.cs(219,74): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2124460Z   obj\Release\monoandroid81\g\XamlCodeGenerator\PlaybackControls_a640c024b4ec96fcd73a42d435df6be4.g.cs(241,74): error CS0029: Cannot implicitly convert type 'Android.Views.View' to 'Windows.UI.Xaml.UIElement' [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2127310Z   obj\Release\monoandroid81\g\XamlCodeGenerator\PlaybackControls_a640c024b4ec96fcd73a42d435df6be4.g.cs(241,74): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2130747Z   obj\Release\monoandroid81\g\XamlCodeGenerator\PlaybackControls_a640c024b4ec96fcd73a42d435df6be4.g.cs(5965,5): error CS0029: Cannot implicitly convert type 'Windows.UI.Xaml.Controls.Border' to 'Android.Views.View' [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2132505Z   obj\Release\monoandroid81\g\XamlCodeGenerator\PlaybackControls_a640c024b4ec96fcd73a42d435df6be4.g.cs(4036,76): error CS0029: Cannot implicitly convert type 'Android.Views.View' to 'Windows.UI.Xaml.UIElement' [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2134653Z   obj\Release\monoandroid81\g\XamlCodeGenerator\PlaybackControls_a640c024b4ec96fcd73a42d435df6be4.g.cs(4036,76): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2146248Z   obj\Release\monoandroid81\g\XamlCodeGenerator\PlaybackControls_a640c024b4ec96fcd73a42d435df6be4.g.cs(5923,6): error CS0029: Cannot implicitly convert type 'Windows.UI.Xaml.Shapes.Ellipse' to 'Android.Views.View' [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2148719Z   DisplayRequestAdapter.cs(34,13): error Uno0001: Windows.System.Display.DisplayRequest.RequestRelease() is not implemented in Uno [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2150318Z   DisplayRequestAdapter.cs(26,13): error Uno0001: Windows.System.Display.DisplayRequest.RequestActive() is not implemented in Uno [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
2020-09-23T16:33:52.2152163Z   DisplayRequestAdapter.cs(16,30): error Uno0001: Windows.System.Display.DisplayRequest is not implemented in Uno [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]

https://videolan.visualstudio.com/73ec5719-cee8-4da9-937a-9d8a3993d7f5/_apis/build/builds/3389/logs/26

Using an Uno 2.x control in an Uno 3.x project can cause odd crash exceptions.

Does this mean we can only support 1 version of Uno within one package?

@mitchcapper mitchcapper force-pushed the uno_3_migration_pr branch 2 times, most recently from a558265 to 9992320 Compare September 24, 2020 09:49
@mitchcapper
Copy link
Author

I had a heck of a time getting it to build (just the library in general). I even got some of these similar errors. Eventually to get it to build I was using android 9 and unloaded virtually all the projects other than UWP and android. After going through a slew of changes I tried reverting as much as I could to get it to still work.

I did find now I missed the IOS add so that should fix a few of the errors.

I also got the DisplayRequest errors, which I fixed by making it public rather than internal. As that was all libvlc code I couldn't figure out why that would be a new error. The assembly was properly marked as friend as well. I reverted it back to internal at the end and rebuilt and it was fine.

I am not sure if it just happens when there is not a successful build or if I am missing something.

Looking at the other errors it is likely relating to some of the templating child fetching that macos seems to catch but android doesn't oddly.

I will go through the theming and see. The View is no longer directly assigned as a child so may need to alter how they are grabbing the VideoView.

Otherwise I can see about installing the android 8 sdk to see if that is an issue, or it could also be IOS related (as the windows does the cross building).

In theory the VideoView.Android should only be compiled in for android and ios for ios right? As the cross compile errors seem odd. I could further gate them with platform #ifdefs but I didn't do so as I figured each was only used for its specific case.

@mfkl
Copy link
Member

mfkl commented Sep 24, 2020

I had a heck of a time getting it to build (just the library in general).

Sorry to hear that. Have you followed our contribution guide and had a look at what the CI does and how it is setup? This can be helpful to have the solution building quicker.

In theory the VideoView.Android should only be compiled in for android and ios for ios right?

Yes.

  <ItemGroup Condition="$(TargetFramework.StartsWith('MonoAndroid'))">
    <ProjectReference Include="..\LibVLCSharp.Android.AWindow\LibVLCSharp.Android.AWindow.csproj" PrivateAssets="All" />
    <Compile Include="**\*.Android.*cs" />
    <Page Include="**\*.Android.*xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" />
  </ItemGroup>
  <ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.iOS'))">
    <Compile Include="**\*.iOS.*cs" />
    <Page Include="**\*.iOS.*xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" />
  </ItemGroup>

@@ -262,7 +262,7 @@
AutomationProperties.AccessibilityView="Raw">
<ToolTipService.ToolTip>
<ToolTip x:Name="ThumbnailTooltip">
<ContentPresenter Content="{Binding}" />
<ContentControl Content="{Binding}" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% yet, but essentially ContentPresenter should be grabbing the content based on the source item by default. ContentControl should be used when actually setting content from what I can find. Will test this to validate.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I give up I can't figure out where this tooltip should show up. I have built straight 3.x on uno 2 as well and can't quite find what slider this references. Is this just the position ellipse? If so what should the tooltip be displaying?
image

@mfkl
Copy link
Member

mfkl commented Sep 24, 2020

Does this mean we can only support 1 version of Uno within one package?

tweet-uno

That settles it. We will moving to Uno 3, I guess.

@mitchcapper
Copy link
Author

The other option would be to create an uno 2.x legacy package or new uno 3 package, but in theory as the upgrade to uno 3 shouldn't be too big for users that may just be the logistically simpler option.

I will test the playback controls and further theme issues this weekend hopefully. From what I read that was the correct direction to be going for the sort of binding done.

As for build issues I am a big fan of docker and CI setup scripts and the failures I am sure are my own. A bit busy with work so only had so much time to see if I could fix this (just using libvlc for a side project).

I will try and look at it in more detail to see if there is anything I could think to add that might help other users (some of it is just opaque error messaging from the build system so not much to do about that). I think the solution itself is logistically complex with all the platforms so likely i will RTFM and just see if I can put some more warnings or help for what some errors may actually mean.

@mfkl
Copy link
Member

mfkl commented Sep 24, 2020

The other option would be to create an uno 2.x legacy package or new uno 3 package

Yes, but I don't think it is worth the overhead with packaging, given how few users we seem to have on Uno.

As for build issues I am a big fan of docker

So am I, but I use it for libvlc (https://code.videolan.org/videolan/docker-images), not libvlcsharp (though it has been planned https://code.videolan.org/videolan/LibVLCSharp/-/issues/91).

I will try and look at it in more detail to see if there is anything I could think to add that might help other users (some of it is just opaque error messaging from the build system so not much to do about that). I think the solution itself is logistically complex with all the platforms so likely i will RTFM and just see if I can put some more warnings or help for what some errors may actually mean.

You need all the proper SDKs (Xamarin, netcore, desktop, etc.). Aside from this, the great MSBuildSdkExtras that we use for multi targeting should do the job (it is pulled automagically from the csproj).

@mitchcapper
Copy link
Author

Don't merge this in yet (if you ever would) still want to test some of the templating things. The error was due to not updating to Android 9 as Uno requires (this may also stop you from merging).

@mfkl
Copy link
Member

mfkl commented Sep 30, 2020

Don't merge this in yet (if you ever would) still want to test some of the templating things.

Ok. Yes, I intend to merge your contribution :-)

You can only test UWP and Android, right? Let me know and I'll check iOS.
We also need to make sure the media element is still OK.

@mfkl
Copy link
Member

mfkl commented Oct 17, 2020

Feel free to let me know when this is ready @mitchcapper

@MartinZikmund
Copy link

MartinZikmund commented Mar 11, 2021

@mfkl @mitchcapper Can this be reopened and finalized please? It would be very beneficial to bring support for latest versions of Uno Platform. Happy to help if needed 👍

@jeremyVignelles
Copy link
Collaborator

@MartinZikmund : Feel free to open your own PR to finish the job, I guess :)

@SkyeHoefling
Copy link

@MartinZikmund I would be more than happy to help you look at this. We are going to need support for libvlc with Uno and Android later this year (Q3/Q4 timeline). I am more than happy to donate my time as well as some developers on my team to get this working.

@jeremyVignelles
Copy link
Collaborator

Good to hear, feel free to join the Discord server if you need anything and to synchronize your work 😉

@mitchcapper
Copy link
Author

NOTE! This is not yet ready for merge the templating I am still testing and playing with. From my original PR here are the changes:
*) Targetting the latest uno 3.7.3
*) Android version bumped up to 10 on all android projects. Android 10 is the minimum supported version for google now. Uno did the same (so 10 is minimum for current uno version). If we didn't want to do so the non-uno projects could target a lower android framework likely (let me know and I can revert to 81).
*) The original debate item, ContentPresenter. What VS will now warn or error over is that binding to the content property of it like we were is likely not the right way to be using it (and can result in undefined behavior they warn on). I will still test and validate the change direction here is correct but either the ContentSource should be used or contentcontrol for actual binding from what I have found thus far. If It tests properly though I would assume changes are fine.

@mfkl
Copy link
Member

mfkl commented May 3, 2021

Android version bumped up to 10 on all android projects. Android 10 is the minimum supported version for google now. Uno did the same (so 10 is minimum for current uno version). If we didn't want to do so the non-uno projects could target a lower android framework likely (let me know and I can revert to 81).

Yes please, I'd like to stick to 8.1 for now if possible.

@mfkl
Copy link
Member

mfkl commented Jun 7, 2021

If anyone is still interested to take this up, much appreciated. Will allow us to remove a new needed workaround 00952b6

@mitchcapper
Copy link
Author

So I can't test this as I upgraded VS and ran into a bug, it seems the autobuild system may be hitting that same bug with the latest vs tools.

 MSBUILD : error : Generation failed: System.MissingMethodException: Method not found: 'System.Collections.Immutable.ImmutableList`1<!!0> System.Collections.Immutable.ImmutableList.ToImmutableList(Builder<!!0>)'. [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
MSBUILD : error :    at Microsoft.Build.Evaluation.LazyItemEvaluator`4.UpdateOperation.ApplyImpl(Builder listBuilder, ImmutableHashSet`1 globsToIgnore) [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
MSBUILD : error :    at Microsoft.Build.Evaluation.LazyItemEvaluator`4.LazyItemOperation.Apply(Builder listBuilder, ImmutableHashSet`1 globsToIgnore) [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
MSBUILD : error :    at Microsoft.Build.Evaluation.LazyItemEvaluator`4.LazyItemList.ComputeItems(LazyItemList lazyItemList, ImmutableHashSet`1 globsToIgnore) [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
MSBUILD : error :    at Microsoft.Build.Evaluation.LazyItemEvaluator`4.LazyItemList.GetItemData(ImmutableHashSet`1 globsToIgnore) [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
MSBUILD : error :    at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext() [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
MSBUILD : error :    at System.Linq.Buffer`1..ctor(IEnumerable`1 source) [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
MSBUILD : error :    at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext() [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]
MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate() [D:\a\1\s\src\LibVLCSharp.Uno\LibVLCSharp.Uno.csproj]

@mfkl
Copy link
Member

mfkl commented Jun 14, 2021

See 00952b6 :)

@mfkl
Copy link
Member

mfkl commented Jun 14, 2021

I'll have a look this week.

@@ -14,7 +14,7 @@ public partial class VideoView : VideoViewWrapper<Platforms.iOS.VideoView>
protected override Platforms.iOS.VideoView CreateUnderlyingVideoView()
{
var underlyingVideoView = new Platforms.iOS.VideoView();
Border!.Child = underlyingVideoView;
Border!.AddSubview( underlyingVideoView);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary extra space

@@ -3,7 +3,7 @@
<PropertyGroup>
<Title>LibVLCSharp.Uno</Title>
<Summary>Uno integration for LibVLCSharp</Summary>
<TargetFrameworks>Xamarin.iOS10;MonoAndroid81</TargetFrameworks>
<TargetFrameworks>Xamarin.iOS10;MonoAndroid10.0</TargetFrameworks>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uno 3 requires MonoAndroid10.0 minimum?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK well as not an android developer I didn't fully understand what their requirement was when they moved to android 29 as the min SDK version. Yes MonoAndroid10/API 29 is the minimum for uno, however the "minSdkVersion" for android is Android 5 or API 21 (per: https://platform.uno/docs/articles/getting-started/requirements.html).

Revisiting the earlier discussion if the target sdk does not effect the device minimum do we want to upgrade all projects to 10/11 as only effecting what sdk the user compiling has?

Interestingly the minSdkVersion is not possible to set on any android library only on the final project. so we only set minSdkVersion on
samples/Uno/LibVLCSharp.Uno.Sample.Droid
samples/Uno/Sample.MediaPlayerElement/Sample.MediaPlayerElement.Droid

I will change these to 21, but really any user won't actually know the minSdkVersion.

Google actually requires any app updates or new app submissions to target v29 (again no minimum though). Starting in august that is v30 for new apps and november v30 for existing. Uno does support MonoAndroid11 right now but you could wait a few months to make the sdk change there.

It is funny without the ability to specify a minSdkVersion on a lib the app will just crash if it is run on too low of a device when that api is used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revisiting the earlier discussion if the target sdk does not effect the device minimum do we want to upgrade all projects to 10/11 as only effecting what sdk the user compiling has?

Samples I don't mind. LibVLCSharp.Uno can target MonoAndroid10. But older non-Uno apps may still use MonoAndroid81 so we should keep it on LibVLCSharp.csproj IMHO.

@mitchcapper
Copy link
Author

See 00952b6 :)

Ha! I saw you added that but as I was updating everything to 3.x I didn't even check what it was referencing. Clearly yes the same issue. As I can also repro locally I will make sure to use the latest uno builds and see if it still happens and post to them otherwise.

@mitchcapper mitchcapper force-pushed the uno_3_migration_pr branch 2 times, most recently from 9418ddf to b11554c Compare June 15, 2021 23:30
@mitchcapper
Copy link
Author

One side perk is now it is on 3.8.6 for uno.

@mfkl
Copy link
Member

mfkl commented Jun 16, 2021

Updated my system to try to repro the failure from CI, but I can't repro locally, builds fine here.

2021-06-16T00:22:10.5924892Z   C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1961,3): error XA3001: Could not AOT the assembly: LibVLCSharp.Android.AWindow.dll [D:\a\1\s\samples\Uno\LibVLCSharp.Uno.Sample.Droid\LibVLCSharp.Uno.Sample.Droid.csproj]

Seems to be a recent tooling issue. Should try this work around xamarin/xamarin-android#5764 (comment)

@mitchcapper
Copy link
Author

Seems to be a recent tooling issue. Should try this work around xamarin/xamarin-android#5764 (comment)

Should that be in aWindow referenced or I would assume the android csproj that is failing.

@mfkl
Copy link
Member

mfkl commented Jun 21, 2021

Should that be in aWindow referenced or I would assume the android csproj that is failing.

I'd have guessed the AWindow bindings project. Though the implications of that workaround could be critical

A boolean property that controls whether the linker will insert GC.KeepAlive() invocations within binding projects to prevent premature object collection. Defaults to True for Release configuration builds.

Anyway, I tried it in my fork and the build times out https://videolan.visualstudio.com/73ec5719-cee8-4da9-937a-9d8a3993d7f5/_apis/build/builds/4436/logs/28. I cannot reproduce this build failure locally, everything builds fine.

@mfkl
Copy link
Member

mfkl commented Mar 8, 2022

Closing for inactivity. Feel free to reopen!

@mfkl mfkl closed this Mar 8, 2022
@mfkl mfkl reopened this Mar 8, 2022
@mfkl
Copy link
Member

mfkl commented Mar 8, 2022

"D:\a\1\s\src\LibVLCSharp.sln" (Build target) (1) ->
"D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj" (default target) (33) ->
(_LinkAssembliesShrink target) -> 
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: Mono.Linker.MarkException: Error processing method: 'Windows.UI.Xaml.Style LibVLCSharp.Uno.GlobalStaticResources::get___ImplicitStyle_LibVLCSharp_Uno_VideoView()' in assembly: 'LibVLCSharp.Uno.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve Windows.UI.Xaml.DependencyProperty Windows.UI.Xaml.Controls.Control::TemplateProperty [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.HandleUnresolvedField(FieldReference reference) [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction) [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body) [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method) [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.ProcessQueue() [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    --- End of inner exception stack trace --- [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.ProcessQueue() [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue() [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.Process() [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.Process(LinkContext context) [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context) [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step) [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Pipeline.Process(LinkContext context) [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context) [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res) [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Xamarin.Android.Tasks.LinkAssemblies.RunTask() [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 [D:\a\1\s\samples\Uno\Sample.MediaPlayerElement\Sample.MediaPlayerElement.Droid\Sample.MediaPlayerElement.Droid.csproj]


"D:\a\1\s\src\LibVLCSharp.sln" (Build target) (1) ->
"D:\a\1\s\samples\Uno\LibVLCSharp.Uno.Sample.Droid\LibVLCSharp.Uno.Sample.Droid.csproj" (default target) (34) ->
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000: Mono.Linker.MarkException: Error processing method: 'Windows.UI.Xaml.Style LibVLCSharp.Uno.GlobalStaticResources::get___ImplicitStyle_LibVLCSharp_Uno_VideoView()' in assembly: 'LibVLCSharp.Uno.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve Windows.UI.Xaml.DependencyProperty Windows.UI.Xaml.Controls.Control::TemplateProperty [D:\a\1\s\samples\Uno\LibVLCSharp.Uno.Sample.Droid\LibVLCSharp.Uno.Sample.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.HandleUnresolvedField(FieldReference reference) [D:\a\1\s\samples\Uno\LibVLCSharp.Uno.Sample.Droid\LibVLCSharp.Uno.Sample.Droid.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(647,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction) [D:\a\1\s\samples\Uno\LibVLCSharp.Uno.Sample.Droid\LibVLCSharp.Uno.Sample.Droid.csproj]

@mfkl
Copy link
Member

mfkl commented Mar 9, 2022

Now there is a 4.x Uno stable version..

@mfkl
Copy link
Member

mfkl commented May 23, 2024

Closing for inactivity.

@mfkl mfkl closed this May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants