amay077 / Xamarin.Forms.GoogleMaps

Map library for Xamarin.Forms using Google maps API
https://www.nuget.org/packages/Xamarin.Forms.GoogleMaps/
MIT License
546 stars 346 forks source link

Error building IOS app using v. 3.3.0 #666

Open mikthemonster opened 4 years ago

mikthemonster commented 4 years ago

VERSIONS

PLATFORMS

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.

tonyfonager commented 4 years ago

I have exactly the same issue after upgrading to 3.3.0

Pietervdw commented 4 years ago

Same problem here

amay077 commented 4 years ago

I'm not sure to is AppCenter supports latest iOS SDK and GoogleMaps SDK for iOS.

mikthemonster commented 4 years ago

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.

simonemarra commented 4 years ago

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.

Bustillox commented 4 years ago

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! :)

czenzel commented 4 years ago

+1

katkusmt commented 4 years ago

+1

jocontacter commented 4 years ago

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]

1) Try to target ios project 9.0+ version. I am targeted to 10 2) Add Xamarin.Build.Download package to ios project 3) clean and rebuild

jocontacter commented 4 years ago

ld : warning : directory not found for option '-FGMps-3.5.0/Maps/Frameworks'

check my answer

Pietervdw commented 4 years ago

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

amnso commented 4 years ago

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.

simonemarra commented 4 years ago

It worked for me!!! thank you @jocontacter

amnso commented 4 years ago

@simonemarra Can you share simple ?

jocontacter commented 4 years ago

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+

mikthemonster commented 4 years ago

How do you target ios project 9.0+ when using app center?

jocontacter commented 4 years ago

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

ianvink commented 4 years ago

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.

jocontacter commented 4 years ago

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

mikthemonster commented 4 years ago

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'.

jocontacter commented 4 years ago

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

simonemarra commented 4 years ago

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!!!)

mikthemonster commented 4 years ago

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 :-)

solution

yahiaalnaqeeb commented 4 years ago

To resolve the problem your setting as following steps

it work for me correctly

MrMiso commented 4 years ago

Nothing worked for me until I updated to VS 2019 from VS 2017 and updated VS for Mac.

Sigve84 commented 4 years ago

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.

kidhaxx commented 4 years ago

I have the same problem with Xamarin.Build.Download.targets (0.4.11) or the last version.

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'

laitauchocolat commented 4 years ago

any update ?

AlonikiX commented 4 years ago

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'

AlonikiX commented 4 years ago

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:

  1. 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
  2. Copy this dll, paste it to /Users/YOUR_USER_NAME/.nuget/packages/xamarin.google.ios.maps/3.5.0/lib/xamarinios10/Google.Maps.dll
  3. Open your project, add Xamarin.Forms.GoogleMaps to your .netstandard project, and Xamarin.Forms.GoogleMaps and Xamarin.Google.iOS.Maps and Xamarin.Build.Download(v0.4.11) to your .iOS project.
  4. Clean and Rebuild your project
  5. Sometimes you may need to delete your packages folder and all bin and obj and restart everything
  6. Run the app

It works well in my case, hope it will be helpful for you : )

kidhaxx commented 4 years ago

Hello !

When I try to run the sample project, I have the same error :

/Users/[USER]/Downloads/Xamarin.Forms.GoogleMaps-master/XFGoogleMapSample/packages/Xamarin.Build.Download.0.4.11/build/Xamarin.Build.Download.targets(3,3): Error: Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' (XFGoogleMapSample.iOS)

The size of DLL XFGoogleMapSample/packages/Xamarin.Google.iOS.Maps.3.5.0/lib/xamarinios10/Google.Maps.dll is always to 0 kb

AlonikiX commented 4 years ago

Hello !

When I try to run the sample project, I have the same error :

/Users/[USER]/Downloads/Xamarin.Forms.GoogleMaps-master/XFGoogleMapSample/packages/Xamarin.Build.Download.0.4.11/build/Xamarin.Build.Download.targets(3,3): Error: Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' (XFGoogleMapSample.iOS)

The size of DLL XFGoogleMapSample/packages/Xamarin.Google.iOS.Maps.3.5.0/lib/xamarinios10/Google.Maps.dll is always to 0 kb

try using this one, this is compiled from the sample project. https://drive.google.com/file/d/1Ll8UvWBvzp-5K5npWmJa1pybs5oyl-N8/view?usp=sharing

davidbuckleyni commented 4 years ago

Please never ever use dlls that have been precompiled always share the source in another fork this could affect your machine.

On Sun, Dec 15, 2019 at 10:26 PM AlonikiX notifications@github.com wrote:

Hello !

When I try to run the sample project, I have the same error :

/Users/[USER]/Downloads/Xamarin.Forms.GoogleMaps-master/XFGoogleMapSample/packages/Xamarin.Build.Download.0.4.11/build/Xamarin.Build.Download.targets(3,3): Error: Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' (XFGoogleMapSample.iOS)

The size of DLL XFGoogleMapSample/packages/Xamarin.Google.iOS.Maps.3.5.0/lib/xamarinios10/Google.Maps.dll is always to 0 kb

try using this one, this is compiled from the sample project. https://drive.google.com/file/d/1Ll8UvWBvzp-5K5npWmJa1pybs5oyl-N8/view?usp=sharing

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/amay077/Xamarin.Forms.GoogleMaps/issues/666?email_source=notifications&email_token=ABK34HOQ2XIUAANSOKHWJD3QY2VHTA5CNFSM4JETHL62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG5D2AA#issuecomment-565853440, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABK34HO75SJHRF7PCDOT3CTQY2VHTANCNFSM4JETHL6Q .

--

Regards David Buckley M: 07871 884 546

AlonikiX commented 4 years ago

@davidbuckleyni Thanks for the suggestion, you are right about that. So @kidhaxx, even though I am the one who compiled this dll and using it myself, I won't recommend you to use this dll directly. However, I still don't know why the sample project cannot be compiled on some machines, so there is no source code I can share with you. The dll will serve as the final resort to the problem if you really want to get this library work but still cannot find any other solutions.

kidhaxx commented 4 years ago

Thanks @AlonikiX for your DLL. I'm not tested with this file for now.

I tested with many Solutions (map 3.2.1 + build.Download 0.44.11)... With the last version. But for each trial I every the same error... @AlonikiX can you give me your version of xcode, xamarin and visual plz?

Thanks for your help :)

SergioAMG commented 4 years ago

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

It worked for me while nothing else did.

AyonGupta commented 4 years ago

@SergioAMG Still getting the error "Xamarin.Build.Download.targets(3,3): Error: Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' "

lupialex commented 4 years ago

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

It worked for me while nothing else did.

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

It worked for me while nothing else did.

This solution not work for me. Do you have another solution?

AyonGupta commented 4 years ago

@amay077 Still getting the error "Xamarin.Build.Download.targets(3,3): Error: Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' "

Any updates?

stesvis commented 4 years ago

@amay077 Still getting the error "Xamarin.Build.Download.targets(3,3): Error: Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' "

Any updates?

Same here:

.nuget/packages/xamarin.build.download/0.4.11/build/Xamarin.Build.Download.targets(3,3): Error: Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Pirate911 commented 4 years ago

Hi all , I tried all sugguestions here but none of them worked ! Any help is appreciated .

nor0x commented 4 years ago

Same for me - tried every solution but can't get it to work

patriarch commented 4 years ago

Any update ?

Nothing proposed helped

sadiqoyapero commented 4 years ago

Here are the steps that worked for me:

  1. Uninstall Xamarin.Google.iOS.Maps 3.5.0 from your iOS project
  2. Go to /Users/YOUR_USER_NAME/.nuget/packages/xamarin.google.ios.maps/, delete the folder named '3.5.0'.
  3. Go back and install Xamarin.Google.iOS.Maps v3.1.0 to your .iOS project.
  4. After v3.1.0 installs, upgrade Xamarin.Google.iOS.Maps to 3.5.0
  5. Clean and Build your project
  6. Run the app

Good luck!

nor0x commented 4 years ago

@sadiqoyapero works for me! Thanks

patriarch commented 4 years ago

@sadiqoyapero works for me also! Thanks a lot for the solution

Pirate911 commented 4 years ago

Here are the steps that worked for me:

  1. Uninstall Xamarin.Google.iOS.Maps 3.5.0 from your iOS project
  2. Go to /Users/YOUR_USER_NAME/.nuget/packages/xamarin.google.ios.maps/, delete the folder named '3.5.0'.
  3. Go back and install Xamarin.Google.iOS.Maps v3.1.0 to your .iOS project.
  4. After v3.1.0 installs, upgrade Xamarin.Google.iOS.Maps to 3.5.0
  5. Clean and Build your project
  6. Run the app

Good luck!

I tried what you suggested exactly but it didn't work :(

MarcoSal commented 4 years ago

I have installed, uninstalled and updated several nuget packages. In the end I have Xamarin.Google.iOS.Maps 3.1.0, Xamarin.Forms.GoogleMaps 3.3.0 without Xamarin.Build.Download (installed and uninstalled).

QXLTD commented 4 years ago

I am able to resolve an issue with following NuGet package and its version could resolve your issue

For more reference check configuration with this project Xamarin.Forms.GoogleMaps

JimmyPun610 commented 4 years ago

Here are the steps that worked for me:

  1. Uninstall Xamarin.Google.iOS.Maps 3.5.0 from your iOS project
  2. Go to /Users/YOUR_USER_NAME/.nuget/packages/xamarin.google.ios.maps/, delete the folder named '3.5.0'.
  3. Go back and install Xamarin.Google.iOS.Maps v3.1.0 to your .iOS project.
  4. After v3.1.0 installs, upgrade Xamarin.Google.iOS.Maps to 3.5.0
  5. Clean and Build your project
  6. Run the app

Good luck!

I think this is working. My flow

  1. Install Xamarin.Forms.GoogleMaps 3.3
  2. Install Xamarin.Google.iOS.Maps 3.7.0.1
  3. Build and it success