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

[NEED FEEDBACK]Version 4.0.0-BETA1 Published #729

Open
amay077 opened this issue Jul 26, 2020 · 46 comments
Open

[NEED FEEDBACK]Version 4.0.0-BETA1 Published #729

amay077 opened this issue Jul 26, 2020 · 46 comments

Comments

@amay077
Copy link
Owner

amay077 commented Jul 26, 2020

I published Xamarin.Forms.GoogleMaps ver 4.0.0-BETA1 to nuget.

https://www.nuget.org/packages/Xamarin.Forms.GoogleMaps/4.0.0-BETA1

This version depends latest SDK for Android and iOS.
Also does not support .NET Standard 1.0(only .NET Standard 2.0).

Android

  • Xamarin.Forms (>= 4.5.0.495)
  • Xamarin.Android.Support.v7.AppCompat (>= 28.0.0.3)
  • Xamarin.GooglePlayServices.Maps (>= 71.1610.1)

iOS

  • Xamarin.Forms (>= 4.5.0.495)
  • Xamarin.Google.iOS.Maps (>= 3.7.0.1)

Please try in your apps and give me feedback!

@themronion
Copy link

Hooray!!!!

@codercampos
Copy link

Let me try something today.

@jBijsterboschNL
Copy link

It definitely fixed the GooglePlayServices version mismatch (we are also using OneSignal and GooglePlayServices.Auth). We will thoroughly test the GoogleMaps control in the next weeks and let you know our findings (if any). Cheers

@themronion
Copy link

I haven't found issues with my app. The only thing is that UWP is now unsupported, but u warned about this, no problem - just used the old version for uwp. Nice job! Though i have a question, are the icons for android now being loaded from resources? @amay077

@ralphyaadar
Copy link

App crashes when launching map on iOS.

System.NullReferenceException: Object reference not set to an instance of an object.
at Xamarin.Forms.GoogleMaps.iOS.MapRenderer.UpdateIsShowingUser (System.Nullable`1[T] initialMyLocationButtonEnabled)

@themronion
Copy link

themronion commented Aug 14, 2020

@StryderJermaine did u ask the location permission before showing the user?

@ralphyaadar
Copy link

ralphyaadar commented Aug 14, 2020

@StryderJermaine did u ask the location permission before showing the user?

@themronion Yes. I have this in the info.plist.

NSLocationWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
NSLocationAlwaysAndWhenInUseUsageDescription

@themronion
Copy link

@StryderJermaine its not enough. U should prompt a user whether he agrees to share the location. Permissions, xamarin essentials

@ralphyaadar
Copy link

@themronion I don't think that's the problem because when I use Xamarin.Forms.Maps, it works without location permissions.

@themronion
Copy link

themronion commented Aug 15, 2020

@StryderJermaine Still, try it, because here showing the location may be enabled by default

@ralphyaadar
Copy link

@themronion Alright. I've added location permissions. Still throwing the same error.

@ralphyaadar
Copy link

App crashes when launching map on iOS.

System.NullReferenceException: Object reference not set to an instance of an object.
at Xamarin.Forms.GoogleMaps.iOS.MapRenderer.UpdateIsShowingUser (System.Nullable`1[T] initialMyLocationButtonEnabled)

@amay077 Can you help with this?

@themronion
Copy link

themronion commented Aug 29, 2020

@StryderJermaine i've updated my vs 2019 version (and the xamarin.ios version as too i guess) and started to receive this error as well. Which versions are u using? Might be worth to take a look @amay077

@KirstyLH
Copy link

KirstyLH commented Sep 3, 2020

I'm getting the same "Object reference not set to an instance of an object." error and haven't been able to find a solution for it. Have tried every suggestion in terms of nuget package versions that I could find, nothing seems to change that it crashes on attempting to load the map. Any help with this would be appreciated.

@themronion
Copy link

@felipechavez which version of xamarin.ios and visual studio are u using? I've upgraded to the latest and started to get that error. Maybe it has to do something with that

@themronion
Copy link

I'm getting the same "Object reference not set to an instance of an object." error and haven't been able to find a solution for it. Have tried every suggestion in terms of nuget package versions that I could find, nothing seems to change that it crashes on attempting to load the map. Any help with this would be appreciated.

And u too, can u confirm that this happens on the latest versions of vs/xamarin.ios?

@themronion
Copy link

themronion commented Sep 3, 2020

@amay077

private void UpdateIsShowingUser(bool? initialMyLocationButtonEnabled = null)
i suppose the problem is somewhere here

@felipechavez
Copy link

felipechavez commented Sep 3, 2020

Hi @themronion , i have:

Visual Studio Community 2019 for Mac
Version 8.7.4 (build 38)

Xamarin.iOS
Version: 13.20.2.2 (Visual Studio Community)
Build date: 2020-07-18 18:45:00-0400

The problem is that probably, the Xamarin.iOS version. The latest is 13.99

@themronion
Copy link

@felipechavez i think so as well

@themronion
Copy link

But @amay077 is not answering as usual so there is nothing we can do about it)

@KirstyLH
Copy link

KirstyLH commented Sep 4, 2020

@felipechavez - thanks, but I followed all the instructions in terms of setting up the Google api keys. They are not the problem.

I have the maps working for both Android and UWP - I am trying to now incorporate an ios project into an existing solution. I have been searching for a workaround for days. It appears to be tied to the build on Visual Studio for Windows (without a Mac build environment) feature of the latest version of Visual Studio 2019. Here is the platform I am using:

Visual Studio Enterprise 2019
Version 16.7.2 which has built in Xamarin.iOS 13.20.2.2

I don't want to link to our build Mac most of the time as I am working remotely and don't necessarily have physical access to it all the time, so I've been using the windows local build to test. I have tried every combination of xamarin.forms and xamarin.forms.googlemaps I can think of - removed nuget caches, cleared the obj and bin folders, rebuilt, restarted visual studio, uninstalled the app from the device - the error never changes and the app crashes out on any page a map is trying to render.

@themronion
Copy link

@KirstyLH i think we figured out the problem. It is the problem with hotreload. Since i tried with it as well. Also hotreload haven't managed to start up my firebase services. So i think now it can't work properly with google services. @StryderJermaine were u using hotreload?

@themronion
Copy link

The last time i tried with the mac build host everything was ok. Maybe we should write to Microsoft about this?

@dalton5
Copy link

dalton5 commented Sep 8, 2020

Hi,

I tested the map with Androidx and I have an error I did not have before.

'Error using newLatLngBounds(LatLngBounds, int): Map size can't be 0. Most likely, layout has not yet occured for the map view. Either wait until layout has occurred or use newLatLngBounds(LatLngBounds, int, int, int) which allows you to specify the map's dimensions.'

Do you know what could be the cause? It occurs when I use wait MapValue.AnimateCamera(newBoundsArea, TimeSpan.FromSeconds(3)); in the OnAppearing event of my page.

In Android not x I did not have the issue.

@themronion
Copy link

themronion commented Sep 8, 2020

@dalton5 I had this error before. The error states in details what is wrong: "Most likely, layout has not yet occured for the map view." This means that you are trying to call the method when the map hasn't been rendered yet. Just try to call the method a little bit later

@ralphyaadar
Copy link

@KirstyLH i think we figured out the problem. It is the problem with hotreload. Since i tried with it as well. Also hotreload haven't managed to start up my firebase services. So i think now it can't work properly with google services. @StryderJermaine were u using hotreload?

HotRestart (for iOS). After disabling HotRestart and connecting to a mac host, the issue was resolved

@felipechavez
Copy link

felipechavez commented Sep 9, 2020

anyone else having trouble uploading the app to the AppStore? I found the following link in a quick search, and this one that has a solution in the last answer

I had to downgrade back to 3.3.0 on ios due to #728

@kgouraw
Copy link

kgouraw commented Sep 9, 2020

I have updated my project to Xamarin Forms 4.7.x, and also migrated Android project to AndroidX support library. This version 4.0.0-BETA1 works fine for me on both platforms iOS and Android. Thanks @amay077, when are you releasing it as a stable release version? Can you go to the App/Play Store with the current BETA version?

@jBijsterboschNL
Copy link

@amay077, we are using this beta version as well. Didn't ran into any issues so far. We are using Pins, Polygons, custom Info Window and probably some more features...

Something else: could you release a new NuGet version to release the change that the Pin class is no longer sealed? This is a change we would want at the moment and we've noticed that the code fix was already in place, but not yet released in a new NuGet package.

@simonemarra
Copy link
Contributor

I'm starting a brand new project using AndroidX out of the box. Actually on Android it seems to work correctly but I need some more time to check all the features I will use!

@gsgou
Copy link

gsgou commented Oct 11, 2020

@amay077 in iOS 14 with Xamarin.iOS 14.0.0.0
the currentLocationMarker is not showing the default blue dot icon.

Screenshot 2020-10-11 at 15 39 08

@sarthak1995-26
Copy link

sarthak1995-26 commented Dec 4, 2020

Polyline not showing on Android.On iOS it's showing fine.Do we need to install any Any Android.Support libraries

@themronion
Copy link

@sarthak1995-26 More info pls. A 100% the issue is in ur code. Show us how you make a polyline and display it

@sarthak1995-26
Copy link

sarthak1995-26 commented Dec 5, 2020

If there was something wrong in code polyline should not be shown on iOS.But yes I have not installed any android support library since I am using AndroidX.

Tested on Android 10
Xamarin Version : Latest Stable

@sarthak1995-26
Copy link

This is the code I am using

map.Polylines.Clear();
var polyline = new Polyline();
var positions = (Enumerable.ToList(PolylineHelper.Decode(rslt.Data.routes.First().overview_polyline.points)));
 foreach (var p in positions)
{
   polyline.Positions.Add(p);
}
polyline.IsClickable = false;
polyline.StrokeColor = Color.FromHex("#f0b85c");
polyline.StrokeWidth = 5f;
polyline.Tag = "POLYLINE";
map.Polylines.Add(polyline);

@sarthak1995-26
Copy link

sarthak1995-26 commented Dec 5, 2020

I am getting overview_polyline.points from Google direction api. This same code creates polyline on iOS but shows nothing on android
There maybe more then 300 hundred position in a polyline I am showing. that might be causing issue not sure though

@sarthak1995-26
Copy link

@themronion are you able to replicate it or do you need something else from me let me know 👍 .

@themronion
Copy link

themronion commented Dec 9, 2020

@sarthak1995-26 dunno man, maybe try commenting out the polyline.Tag and the polyline.StrokeWidth line to see if the problem is there. You can also try commenting out the polyline.IsClickable line

@sarthak1995-26
Copy link

sarthak1995-26 commented Dec 11, 2020

I think problem is with StrokeColor or StrokeWidth property I tried a polygon too.It does show a fill color but doesn't render's the stroke on boundary.Though on iOS it does show stroke

@themronion
Copy link

@sarthak1995-26 try strokewidth = 5 instead of 5f

@Sarthak261995
Copy link

tried but didn't worked :( @themronion thank you for your help mate will try something else or something should be wrong with my app since other people commented on this thread did not encountered this problem.

@PaoloLeva
Copy link

PaoloLeva commented Jan 31, 2021

I get this exception on Android, the same code works fine on iOS

InnerException {System.NullReferenceException: Object reference not set to an instance of an object. at Xamarin.Forms.GoogleMaps.Android.MapRenderer..ctor (Android.Content.Context context) [0x0005e] in <9a1405b985b545d8996707dd11469b82>:0 at (wrapper managed-to-native) S…} System.NullReferenceException

In my app I do not need to show the user position so I do not request the access to the GPS.
I also tried removing all controls to the map, just invoking a plain Map in the XAML, but it still breaks on that exception.
I am using Xamarin.Forms 5.0.0.1931

@sermetk
Copy link

sermetk commented May 21, 2021

Polyline not showing on Android.On iOS it's showing fine.Do we need to install any Any Android.Support libraries

Have you tried to use outside the scrollview?

@spinitwide
Copy link

Have you tried to use outside the scrollview?

OMG, this solved the polyline issue for me. Why oh why does this not work on Android within a scrollview, does anyone know? All good in iOS.

@AlonRom
Copy link

AlonRom commented Feb 20, 2022

@amay077 You have an estimate of when this version will be released as stable?

@PaoloLeva
Copy link

@AlonRom it seems that this project is abandoned. Unfortunately because it was by far the best implementation of google maps for Xamarin. Let's hope someone else with enough skills will revive it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests