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

MAUI RC1 is not compatible with Xamarin.iOS NuGet packages #6221

Closed
rricarrdo opened this issue Apr 19, 2022 · 2 comments
Closed

MAUI RC1 is not compatible with Xamarin.iOS NuGet packages #6221

rricarrdo opened this issue Apr 19, 2022 · 2 comments
Labels
platform/iOS 🍎 s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working

Comments

@rricarrdo
Copy link

rricarrdo commented Apr 19, 2022

Description

There is an issue with MAUI not being compatible with Xamarin.iOS packages the same way as it is compatible with Xamarin.Android packages. For example:

If you reference a Xamarin iOS package like Xamarin.Google.iOS.Maps, the package will be installed in all of the platforms (android, ios, maccatalyst, windows), and the classes will not be available to be referenced inside the “Platforms.iOS” project.

The same does not happen with Xamarin.Android packages such as Xamarin.GooglePlayServices.Maps. When installing the package, it is installed only inside the Android platform, and the package can be normally referenced inside the “Platforms.Android” project.

The same behavior can be observed on other Xamarin packages as well.

Steps to Reproduce

  1. Create a new MAUI project on Visual Studio for Windows
  2. Add the NuGet package Xamarin.Google.iOS.Maps
  3. Check that the package is referenced into all of the platforms (android, ios, maccatalyst, windows)
  4. Try to reference the package inside the "Platforms > iOS > AppDelegate.cs" file by adding the following line of code (or any other call to the package)
    Google.Maps.Loader loader = new Google.Maps.Loader();
  5. Check that the package is not found
  6. Add the NuGet package Xamarin.GooglePlayServices.Maps
  7. Confirm that the package is referenced only in the Android platform
  8. Try to reference the package inside the "Platforms > Android > MainActivity.cs" file by adding the following line of code:
    Android.Gms.Maps.MapFragment map = new Android.Gms.Maps.MapFragment();
  9. Check that the package is found correctly

Version with bug

Release Candidate 1 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

Visual Studio 17.2.0 Preview 3.0 (Windows); MAUI RC1; Xamarin.iOS 15.9.0.100; Xamarin.Android 12.3.0.3

Did you find any workaround?

No workaround found so far.

Relevant log output

No response

@rricarrdo rricarrdo added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Apr 19, 2022
@drasticactions
Copy link
Contributor

Xamarin.iOS is "legacy" and references the older Mono stack libraries. Those, I believe, won't work on net6 projects at all and would have to be rebuilt as net6.0-ios projects. The Xamarin.Android projects "happen" to work, but it's not by design to, it's more of a happy accident.

This isn't a MAUI issue, it's a net6.0 one. You would have the same issue if you had a Xamarin.iOS built library and tried referencing it from net6.0-ios, without MAUI at all.

@GalaxiaGuy
Copy link
Contributor

xamarin/xamarin-macios#13087

@Redth Redth closed this as completed Apr 19, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/iOS 🍎 s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants