Xamarin.Forms.GoogleMaps
Xamarin.Forms.GoogleMaps copied to clipboard
Error building IOS app using v. 3.3.0
VERSIONS
- Xamarin.Forms.GoogleMaps - 3.3.0
- Xamarin.Forms -4.3.0.908675
PLATFORMS
- [ ] Android
- [x] iOS
- [ ] UWP
ACTUAL BEHAVIOR
After updating Xamarin.Forms.GoogleMaps from version 3.2.1 to 3.3.0 our build server (Visual Studio App Center) fails to build for IOS. We get the following error:
MTOUCH : error MT2101: Can't resolve the reference 'Foundation.NSArray Foundation.NSArray::FromNSObjects(!!0[])', referenced from the method 'System.Void Google.Maps.Polyline::set_Spans(Google.Maps.StyleSpan[])' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. [/Users/runner/runners/2.159.2/work/1/s/iOS/WorkingWithMaps.iOS.csproj]
If I re-install v 3.2.1 the build is working, but as soon as I update to 3.3.0 the build fails.
I have exactly the same issue after upgrading to 3.3.0
Same problem here
I'm not sure to is AppCenter supports latest iOS SDK and GoogleMaps SDK for iOS.
I just got this reply from AppCenter:
It seems that latest version of map was not supported by AppCenter that's why it was failed, I am forwarding this to our team and will update you when i will get any response from them.
Actually I'm not using AppCenter in my App and few minutes ago I tried to update to v3.3.0. Same problem, the build process fails on iOS. I also tested a delete of bin and obj project folders but the problem remains.
After a simple downgrade of Xamarin.Forms.GoogleMaps package (only on iOS project) the app returned to build and work correctly.
My Xcode version is 11.1 (I don't use any preview version, only stable releases).
Following is a error from build log I think is responsible of the problem:
ld : warning : directory not found for option '-FGMps-3.5.0/Maps/Frameworks'
ld : warning : directory not found for option '-FGMps-3.5.0/Maps/Frameworks'
ld : warning : directory not found for option '-FGMps-3.5.0/Base/Frameworks'
MTOUCH : warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
clang : error : linker command failed with exit code 1 (use -v to see invocation)
error MT5209 : Native linking error : warning: directory not found for option '-FGMps-3.5.0/Maps/Frameworks'
error MT5209 : Native linking error : warning: directory not found for option '-FGMps-3.5.0/Maps/Frameworks'
error MT5209 : Native linking error : warning: directory not found for option '-FGMps-3.5.0/Base/Frameworks'
error MT5209 : Native linking error : framework not found GoogleMaps
MTOUCH : error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -ObjC -ObjC -lc++ -lz
MTOUCH : error MT5202: Native linking failed. Please review the build log.
I tested all the link options availble: Don't Link, Link framework and SDKs Only, Link all. No differences.
I have the same error as @simonemarra. i even tried using the solutions from Microsoft documentation (which can be seen here). Im looking forward for a solution. Thanks in advance! :)
+1
+1
MTOUCH : error MT2101: Can't resolve the reference 'Foundation.NSArray Foundation.NSArray::FromNSObjects(!!0[])', referenced from the method 'System.Void Google.Maps.Polyline::set_Spans(Google.Maps.StyleSpan[])' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. [/Users/runner/runners/2.159.2/work/1/s/iOS/WorkingWithMaps.iOS.csproj]
- Try to target ios project 9.0+ version. I am targeted to 10
- Add Xamarin.Build.Download package to ios project
- clean and rebuild
ld : warning : directory not found for option '-FGMps-3.5.0/Maps/Frameworks'
check my answer
Adding the Xamarin.Build.Download NuGet package to my iOS project, as suggested by @jocontacter, was the solution. The project now builds on both my local machine and on AppCenter
I add the Xamarin.Build.Download NuGet package to my iOS project but have these problem
'GMps-3.5.0\Base\Frameworks\GoogleMapsBase.framework' could not be found.
'GMps-3.5.0\Maps\Frameworks\GoogleMaps.framework' could not be found.
'GMps-3.5.0\Maps\Frameworks\GoogleMapsCore.framework' could not be found.
It worked for me!!! thank you @jocontacter
@simonemarra Can you share simple ?
I add the Xamarin.Build.Download NuGet package to my iOS project but have these problem
'GMps-3.5.0\Base\Frameworks\GoogleMapsBase.framework' could not be found.
'GMps-3.5.0\Maps\Frameworks\GoogleMaps.framework' could not be found.
'GMps-3.5.0\Maps\Frameworks\GoogleMapsCore.framework' could not be found.
try to target ios project 9.0+
How do you target ios project 9.0+ when using app center?
How do you target ios project 9.0+ when using app center?
I don't use the appcenter, but i think there is the same: edit info.plist
After deleting the bin/obj of all projects and adding the Build Nuget to every project and targetted iOS 9 in the info.plist it worked for me.
Note: I had to add the NuGet to all my projects.
After deleting the bin/obj of all projects and adding the Build Nuget to every project and targetted iOS 9 in the info.plist it worked for me.
Note: I had to add the NuGet to all my projects.
now, after all of this, if you remove X.B.D package from .netstandard lib, your project will not be compiled? just interesting
I still get the same build error in Visual Studio App Center. I tried all the suggestions:
I changed my Info.Plist (from 9.0 to 10.0):
And added Xamarin.Build.Download to all Xamarin projects.
Still the same error: MTOUCH : error MT2101: Can't resolve the reference 'Foundation.NSArray Foundation.NSArray::FromNSObjects(!!0[])', referenced from the method 'System.Void Google.Maps.Polyline::set_Spans(Google.Maps.StyleSpan[])' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.
I still get the same build error in Visual Studio App Center. I tried all the suggestions:
I changed my Info.Plist (from 9.0 to 10.0):
MinimumOSVersion 10.0
And added Xamarin.Build.Download to all Xamarin projects.
Still the same error: MTOUCH : error MT2101: Can't resolve the reference 'Foundation.NSArray Foundation.NSArray::FromNSObjects(!!0[])', referenced from the method 'System.Void Google.Maps.Polyline::set_Spans(Google.Maps.StyleSpan[])' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.
try >=12
Hi! I'm still having issues using iOS13.2 and XCode 11.2 (11B52). The app don't load correctly the maps, it has too much bugs, etc...
I don't know what is happening, but at the moment I downgraded my Xamarin.Forms.GoogleMaps version to 3.2.1 and it works correctly.
@amay077 at the moment I cannot manage to write down all the bugs using the last release version, and I don't know if it could be a good idea to try to update the Xamarin.Forms.GoogleMaps package if Apple doesn't stop to release updates on iOS at the same speed as I debug my App code (iOS13.2 was released before to have a Xcode stable version compatible!!!)
I finally found a solution to my problem:
In Microsoft App Center there is a setting: “SDK version”. An old version was selected but as soon as I changed it to the latest version (13.4) it worked :-)
To resolve the problem your setting as following steps
-
Downloaded Xamarin.Forms.GoogleMaps version 3.3.0
-
Downloaded Xamarin.Google.IOS.Maps version 3.5.0
-
Downloaded Xamarin.Build.Download version 0.4.11
-
Open Info.plist
-
in Deployment Info option
-
make Deployment Target Equal to 9.0
it work for me correctly
Nothing worked for me until I updated to VS 2019 from VS 2017 and updated VS for Mac.
I get this one: nuget/packages/xamarin.build.download/0.4.11/build/Xamarin.Build.Download.targets(74,3): error : Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' Done building project "" -- FAILED.
I have the same problem with Xamarin.Build.Download.targets (0.4.11) or the last version.
- I clean Nugget cache
- Delete bin/obj folder
- Clean solution
- Check Deployment >= 9.0
But I always have this error : nuget/packages/xamarin.build.download/0.4.11/build/Xamarin.Build.Download.targets(74,3): error : Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
any update ?
Same issue, always get nuget/packages/xamarin.build.download/0.4.11/build/Xamarin.Build.Download.targets(74,3): error : Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
Hi all, I think I have found a solution. If you check /Users/YOUR_USER_NAME/.nuget/packages/xamarin.google.ios.maps/3.5.0/lib/xamarinios10/Google.Maps.dll
, the file size may be 0, and that's why the program couldn't load this dll.
Here is the steps to fix this issue:
- Run the sample project, you should see a valid dll at
/Xamarin.Forms.GoogleMaps-master/XFGoogleMapSample/packages/Xamarin.Google.iOS.Maps.3.5.0/lib/xamarinios10/Google.Maps.dll
- Copy this dll, paste it to
/Users/YOUR_USER_NAME/.nuget/packages/xamarin.google.ios.maps/3.5.0/lib/xamarinios10/Google.Maps.dll
- Open your project, add
Xamarin.Forms.GoogleMaps
to your.netstandard
project, andXamarin.Forms.GoogleMaps
andXamarin.Google.iOS.Maps
andXamarin.Build.Download(v0.4.11)
to your.iOS
project. -
Clean
andRebuild
your project - Sometimes you may need to delete your
packages
folder and allbin
andobj
and restart everything - Run the app
It works well in my case, hope it will be helpful for you : )