-
Notifications
You must be signed in to change notification settings - Fork 4
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
[MAUI] Update the bindings to work in .net 6+ (Maui) #11
Comments
The first step will be to make sure all the referenced nuget dependencies support .net6 android/ios I've had an initial audit, most do thankfully. There are two that don't:
|
I think we need to create an "Android Java Library Binding" for the jar to support MAUI droid. Does anyone know the build action needed for the aar? LibraryProjectZip is no longer available, which is the xamarin build action to be able to access both code and resources from the .aar. |
Hi Adam, Have a good day, |
Hey @mdima, nice to hear from you! Thanks for the tip. I've renamed the repo now to a more generic dotnet name, and started the process of adding MAUI support in a separate sln. For android, I have the aar loading now I've set it to the correct build configuration. I am working through some weird missing resource build failures. Have not started iOS yet. If you had any time to jump in and help with either, we'd love the support! |
The lib projects for android are both building now. Trying to build the sample app for android, and getting this: I remember dealing with similar issues during the Xamarin days. Not sure of the solution for MAUI. Adding the missing color resources in manually just throws up a whole bunch of new missing resource build errors. I'm seeing if perhaps we are missing a required nuget package. |
Captain's log: star-date 24th July, Tellus I added the nuget packages to match the xamarin version, and still get the same missing resource errors. I also added a version of the lottieMaui repo for android only. No dice. As of right now, stuck! |
C.C @icalderond if you have any insight |
Ok with much back and forth I think that I have narrowed the problem down to these two nuget packages, neither of which support .net6+ yet. (Funnily enough they are by the same author, the awesome https://github.com/martijn00) <PackageReference Include="Com.Airbnb.Xamarin.Forms.Lottie">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.ExoPlayerSlim">
<Version>2.16.1.12</Version>
</PackageReference> ExoPlayer slim has plans to support Maui, I raised this issue here and they say it should be available soon. As an alternative, I tried using the full-fat exoplayer nuget, which does support .net6. It made me add a new remove node in the MetaData.xml but otherwise compiled. When referencing it via a .net maui project, I saw the missing resource errors. I don't yet know if that is because I added the full fat exoplayer, or if they are coming from missing Lottie stuff... As for Lottie, there is a PR here to upgrade for net6 Baseflow/LottieXamarin#379 - apparently it works for droid but not for iOS yet. The PR has gone stale though and there is no sign of an upgrade. Perhaps someone with more iOS skills than me might consider jumping in. A couple of possible hail-mary alternatives:
When I add SkiaLottie the resource errors go away (or get hidden) but I get these errors I might be able to shim these, will try tomorrow... Tried the shim. These two resource errors went away, but then all the original resource errors reappeared. My current working theory is that they are caused by a dependency in exoplayer full-fat. So I'm going to wait for the slim binding to be available and try again. If after putting that back in, we still get resource errors, they must be because of Lottie.
|
The missing resources are all defined in ZoomCommonLib. I'm wondering if there is an issue with how maui handles one binding library that references another. (HeadProject => MobileRTC => ZoomCommonLib) Adding all the resources from zoomcommon lib manually into my maui android resources, just throws up more missing resource errors though. Mainly from exoplayer... I'm using the full fat library. Maybe I need to look at its dependencies and manually include them .... nope, not that! |
Any updates for the .net maui support? |
No, I am still working through the issues as described in the comments |
An update, although without good news, is that on the MAUIFY branch I used the full fat exoplayer, and a version of lottie that compiled for .net 7, which I hoped would clear up the remaining issues. Yet I still get the exact same errors, so either one of those packages is causing problems, or another package is the problem, or there is a deeper problem with MAUI bindings that I don't understand. If anyone has any wisdom to share, I am all ears! I wish the error messages were more informative - I am certain that the actual error is nothing to do with missing resources, rather that the compile step fails for the actual reason before the resources can be included, and the real error is swallowed somewhere. |
After much much much trial and error and a big dose of help from @timjamwoo I got a zoom call working on MAUI Android! Stay tuned for a PR and a nuget package. iOS support will come soon too hopefully. |
@timjamwoo when doing this for iOS, you have two options. 1) copying the current project from XF over into the maui sln and porting the csproj file to .net 7, or 2) creating a new project from scratch. If you choose option 2, the top one in the screenshot is the project type you need Here are some instructions for the porting option, which will also be useful if you start from scratch as it contains details of breaking changes between xf and iOS you'd have to deal with either way. For Android I used the new project template, but I'm sure either would work fine. |
Required iOS tasks
|
@AdamDiament remaining Android Tasks
|
This might need to be a separate repo, as upgrading the target framework to add maui support will break Xamarin forms. I haven't decided what is best yet. Thoughts welcome, in particular PRs or ways to get XF-Maui side-by-side working.
Possible useful resources
https://learn.microsoft.com/en-us/events/dotnetconf-focus-on-maui/binding-native-libraries-for-dotnet-maui
The text was updated successfully, but these errors were encountered: