No longer working at all for iOS
VERSIONS
- Maui.GoogleMaps - 6.2.0
- .NET SDK - 9.0.0
IDE
- [ ] Rider
- [x] Visual Studio
- [ ] Visual Studio for Mac
PLATFORMS
- [ ] Android
- [x] iOS
ACTUAL BEHAVIOR
Open the sample solution which is provided on GitHub...do nothing...and just try rebuild it for iOS... you get the message below
ACTUAL SCREENSHOTS/STACKTRACE
[Paste stacktrace/scree
nshots/recordings]
EXPECTED BEHAVIOR
The solution should at a minium, at least build! Works OK for Android, however, but not iOS
HOW TO REPRODUCE
Open the sample solution which is provided on GitHub...do nothing...and just try rebuild it for iOS... you get the message above
Verified! Doesn't work for ios-simulator. Please any solution?
Solution: Use in your .csproj:
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
<CodesignProvision>YouApp.iOS</CodesignProvision>
<CodesignKey>Apple Distribution: You Apple Distribution (XXXXXXXXXX)</CodesignKey>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
Thank you for this - I will try it! Also, is there a way to set the max or min zoom allowed on the map? I cannot find any properties to do this on the component?
Still not working...not even on net8....try your sample project...refuses to fully build (linking problem on iOS)...works on Android though. A great shame...because a useful NuGet...(if it worked on iOS)...going to have to create my own code now, can't waste any more time with this NuGet which already wasted a good deal of hours on my side...cost me a week in wasted time and effort! Also, would be good if it worked on net9...won't be long now before it goes net10...Basically, at the moment...its a useless NuGet really, as it stands, until it gets properly fixed...I would not waste any time with it. TEST! TEST! TEST! before release....don't be like Microsoft! ... ;)
Solution: Use in your .csproj:
This didn't work for me either. Can't get the sample project to build for iPhone no matter what I do.
are u using Windows guys? just try on a macbook
No - not using Windows - I have left this NuGet now - developed my own solution without using Google Maps, including pin clustering - could not waste any more time with this NuGet - all the best for the future with this NuGet - I hope you manage to fix all its problems....TEST TEST TEST (for at least Android and iOS)....currently, not working on iOS platform, as stated earlier
We use this solution below
<PropertyGroup Condition="$(Configuration.Contains('iOS'))">
<TargetFramework>net8.0-ios</TargetFramework>
<!--DEBUG ON DEVICE-->
<!-- <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>-->
<!--DEBUG ON SIMULATOR-->
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
<_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly>
</PropertyGroup>
For debugging on device or sim you uncomment the line below respectively.
It is a bit annoying to have this manual approach but it seems to work fine for us.
Thing to note, if you run into the error, you need to uncomment the correct line but then you must clean and rebuild the solution to get it working on your sim.
hope this helps!
Thank you for that - put that in, but I think my problem was before that - the sample project was not even building for iOS - it was locking up...while building...I now found the solution...it was because of some pathetic issue of a file not being "unzipped" / "unpacked"...which I noticed once I put diagnostic output on....I now solved the problem by manually unpacking the file myself!
How ridiculous that I had to do that - not this nuget package fault...more another Microsoft .NET MAUI pile of sh_t with no testing, of course!
See here for details if you have the same build lock when building for iOS....not an issue for Android 👍
I now got at least the sample project to fully build for iOS as well now...and deploy to physical device, and see everything working....but will not do it on the iOS simulator unfortunately, even after following the suggeston above, but at least I got it working on a physical iOS device now, at least!
https://github.com/dotnet/android-libraries/issues/1047
@Barry-Theunissen This can happen from time to time in our devs environments, I had the same issue even using the suggestions mentioned here. Ended up clearing my cache, clean/rebuild things and make it work (on macos and windows).
Remember, this library is a community repository, if it's not working for you, explore other solutions or make a solution for you grabbing this repo to your side.
The Runtime issue is being known for a while and I don't think is Microsoft's fault (neither from the author from this repo) to solve it.
Hope you can find a solution.
Is Microsoft's fault.....NET MAUI must unpack things as required! Most of the time it does...but sometimes, it does not...for some reason! If it is not MS fault...then...if .NET MAUI has some kind of problem unpacking things properly, then it must at least throw a decent message and report back that it is having a problem...at the moment...it does not care...just locks up...leaving the dev none the better with knowledge about what the problem is...basics...BASICS! So many, many problems and bugs with .NET MAUI it is not even funny....1000s...if you check the issues logged on their repos...memory consumption is an absolute joke...known issue that .NET MAUI will not release memory properly on mobile apps...just uses and uses and uses and uses....people even had to write NuGet packages to track and identify and try "fix" memory release issues with .NET MAUI...it is really ridiculoous...NET MAUI Maps is an absolute joke for mobile apps...just consumes and refuses to release memory ridiculously badly...using Google Maps here with this NuGet package goes a long way to solving that "problem"...which is another good thing and advantage of this NuGet. I believe MS has not allocated sufficient dev resources to attend to .NET MAUI...their team is overwhelmed with issues and "bugs" they need to solve...and hardly make a "dent" in the total on each new release of .NET MAUI...I cannot blame the devs at MS...they do their best, I'm pretty sure...the problm lies with MS leadership...who are not providing enough resources to ensure "zero defect" before releases of .NET MAUI...either they do not care...or do not see a big future for .NET MAUI...I am not sure which...but basic premise of any successful business is : 1. "Zero defect". 2. "Deliver on-time, on schedule". 3. "Love your customers". MS has been failing and going down for a few years now, on all THREEE of these things...just not for .NET MAUI, but nearly ALL their products, including lates Windows release even! Rant over. ;)
Trying to use this package for a .net 9 migration of an old XF project where I used the original Google Maps package.
I have it working for Android - and actually even better than the native map as on a limited emulator the native map crashes when I add more than 150-200 pins. But all 471 pins are loaded using this package (together with the binding package)!
However, on iOS simulator I get the same error as mentioned in the top:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.4/18.4.9288/targets/Xamarin.Shared.Sdk.targets(1652,3): error :
clang++ exited with code 1:
ld: building for 'iOS-simulator', but linking in object file (/Users/jda/.nuget/packages/xamarin.google.maps.utils/1.3.9/lib/net8.0-ios17.2/Google.Maps.Utils.iOS.resourc
es/GoogleMapsUtils.framework/GoogleMapsUtils[arm64][2](GoogleMapsUtils_vers.o)) built for 'iOS'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
I have tried this work-around:
<PropertyGroup Condition="$(Configuration.Contains('iOS'))">
<TargetFramework>net9.0-ios</TargetFramework>
<!--DEBUG ON DEVICE-->
<!-- <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>-->
<!--DEBUG ON SIMULATOR-->
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
<_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly>
</PropertyGroup>
with the small adjustment of the TargetFramework. However, not much luck on this. As I am on a Mac M3 (ARM processor) I also tried to change the RuntimeIdentifier to "iossimulator-arm64" just as an experiment. But still no luck...
I also have this in my csproj file:
<!-- Sign to allow splash screen to show on iOS simulators -->
<EnableCodeSigning>true</EnableCodeSigning>
<CodesignRequireProvisioningProfile>true</CodesignRequireProvisioningProfile>
<DisableCodesignVerification>true</DisableCodesignVerification>
Not sure if this is going to collide with the suggestion by @JairoMarques?
If not, then I am not entirely sure where to get the contents of the line: <CodesignKey> and if I need to create an Entitlements.plist and what to put in there... This app has not been released yet for the first time from the "new environment" (VS Code, .net maui) - so that may be the reason I am missing something here...?
Anyone else who knows how to run the project on iOS simulator on .net 9 and Mac Silicon?
Ok, I found a way to make this work. I just share it here if someone else ends up with the same issue.
First, I found this response: https://github.com/themronion/Maui.GoogleMaps/issues/41#issuecomment-2146249534 that indicates that you should just add:
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
</PropertyGroup>
However, that did not work for me - in itself. And this most likely is due to the signing I have added for seeing the splash screen on the emulator. It turns out that I also need to add the <CodesignKey> line and update the target to .net9:
<PropertyGroup Condition="'$(TargetFramework)' == 'net9.0-ios'">
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
<CodesignKey>Apple Distribution: My company name (...)</CodesignKey>
</PropertyGroup>
Final step: How do I find the "key" to add. Well, the easiest is to use this. command to see which identities that are valid:
security find-identity -v -p codesigning
And now it launches in the simulator 😄
Thanks again @themronion for porting this project to .net maui 🙏
I had this same issue with the MS Xamarin.Build.Download package hanging on extraction of GMps-9.1.1.tgz even though it extracted it just fine. It was not able to complete the process and create the .unpacked file in the XamarinBuildDownloadCache directory. I manually created that file and now it builds and deploys to my iPhone when deploying from Visual Studio on my Windows machine.
Turns out there is another fork that replaces Xamarin.Build.Download (Maonaoda.Xamarin.Build.Download) and claims to resolve these extraction issues, however this nuget has a dependency on Xamarin.Build.Download >= 0.11.4
My question is whether an update to this nuget could be submitted that would support the Maonaoda nuget. While the manual extraction workaround seems to work, if I ever clean my project it will force me to take the manual steps again which is not optimal.
Would love to see an update that would support this fork to resolve the download extraction issue.
I had the same issue and tried this workaround with no success
<PropertyGroup Condition="'$(TargetFramework)' == 'net9.0-ios'">
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
<CodesignKey>Apple Distribution: My company name (...)</CodesignKey>
</PropertyGroup>
But when I change RuntimeIdentifier in .cproj.user file - I can build and run my project in iOS Simulator. My vonfiguration is Visual Studio 2022 paired to Mac mini (M4). So, I changed section in .cproj.user from:
<PropertyGroup Condition="'$(TargetPlatformIdentifier)'=='iOS'">
<RuntimeIdentifier>iossimulator-arm64</RuntimeIdentifier>
<PlatformTarget>arm64</PlatformTarget>
</PropertyGroup>
(by default) to:
<PropertyGroup Condition="'$(TargetPlatformIdentifier)'=='iOS'">
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
I hope this info can help someone.