themronion / Maui.GoogleMaps

Map library for MAUI using Google maps API
https://www.nuget.org/packages/Onion.Maui.GoogleMaps/
MIT License
76 stars 33 forks source link

Can't reference Maui.GoogleMaps from net7 project as of 5.0.1 #11

Closed jahmai-ca closed 8 months ago

jahmai-ca commented 1 year ago

VERSIONS

IDE

PLATFORMS

ACTUAL BEHAVIOR

The project/nuget package for Maui.GoogleMaps has had the net7 target removed, which means it can no longer be used in shared projects between multiple platforms without multi-targetting.
This triggers a complete refactor of any project/solution that uses platform agnostic common projects.
There is no reason to force this. None of the built-in XAML components require platform targetting.

ACTUAL SCREENSHOTS/STACKTRACE

N/A

EXPECTED BEHAVIOR

A net7 (platform agnostic) assembly is shipped in the nuget package for use with common projects.

HOW TO REPRODUCE

Create a net7 project and add Maui.GoogleMaps nuget as a reference.
jahmai-ca commented 1 year ago

Change that caused this: https://github.com/amay077/Xamarin.Forms.GoogleMaps/commit/a8db42b9b03eb04187eb8cab71d7c901f5138d6c#r119011892

codercampos commented 1 year ago

How can We fix this in the meantime? Also, it would be a good idea if removing the platform agnostic support does really fixes the crash for iOS in 5.0.0

themronion commented 1 year ago

@codercampos just use a previous version. I will bring back plain net7.0 support after any other issues that i can reproduce and fix or prs will be raised. This one is not critical since, again, the previous nuget version has net7.0

codercampos commented 1 year ago

I'm asking this because the previous version it's causing the iOS crash. For the moment, since I'm migrating a XF app, I don't need the android part.

Please let me know if you need any help for testing, add or fix something 😄

UPDATE For some reason, now it's building on Android, I have an issue rendering the map but I think it's on my side.

I added the lib on Windows and it wasn't building. I rollback the implementation and moved to macOS. Re-added the lib and it works in both iOS and Android.

Another thing that I did it's remove the maccatalyst target framework, maybe that was giving me the issue. I will create a new project on Windows and see what happens.

codercampos commented 1 year ago

I think having the maccatalyst target was causing me the issue. 🤷‍♂️ Thank you everyone! <3

SamuelBachar commented 11 months ago

Hello I had same problem. In my case I could not reference Maui.GoogleMaps.Hosting namespace in MauiProgram.cs I did reinstall package under Android choosen platform and suddenly it works.

Maybe this is also your case image

plppp2001 commented 9 months ago

Hello I had same problem. In my case I could not reference Maui.GoogleMaps.Hosting namespace in MauiProgram.cs I did reinstall package under Android choosen platform and suddenly it works.

Maybe this is also your case image

when you said "I did reinstall package under Android choosen platform and suddenly it works." how did you do this? Which version of this nuget package Maui.GoogleMaps are you using? thanks

Paul

plppp2001 commented 9 months ago

I'm asking this because the previous version it's causing the iOS crash. For the moment, since I'm migrating a XF app, I don't need the android part.

Please let me know if you need any help for testing, add or fix something 😄

UPDATE For some reason, now it's building on Android, I have an issue rendering the map but I think it's on my side.

I added the lib on Windows and it wasn't building. I rollback the implementation and moved to macOS. Re-added the lib and it works in both iOS and Android.

Another thing that I did it's remove the maccatalyst target framework, maybe that was giving me the issue. I will create a new project on Windows and see what happens.

Is this nuget still working for after what you did? which version are you using in you project? Screenshot 2023-12-12 170843

themronion commented 8 months ago

brought back plain net8 support in here: https://github.com/themronion/Maui.GoogleMaps/commit/e7e87d04776503cd8da87cfb1f3a5bd3db427e64