Bug 59152 - geocoder works on iOS and not Android
Summary: geocoder works on iOS and not Android
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-31 15:07 UTC by Trevor Heins
Modified: 2017-12-04 19:07 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Trevor Heins 2017-08-31 15:07:02 UTC
I have working code for a Reverse Geocoder, and know this because I verified it on iOS, but when I deploy to android, it throws an exception. I verified this on the "Xamarin CRM" app as well, I am able to get the map up using my own API key, but when I do a Geocode call, either normal or reverse, it throws an exception.

> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
> at Java.Interop.JniEnvironment+InstanceMethods.CallObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <6cd960837cc24c26bab2a0a29b597627>:0
> at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeAbstractObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00014] in <6cd960837cc24c26bab2a0a29b597627>:0
> at Android.Locations.Geocoder.GetFromLocation (System.Double latitude, System.Double longitude, System.Int32 maxResults) [0x0004b] in <d278c06ad5684d6882c743a94a93ebc2>:0
> at Android.Locations.Geocoder+<>c__DisplayClass15_0.<GetFromLocationAsync>b__0 () [0x00000] in <d278c06ad5684d6882c743a94a93ebc2>:0 
> at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
> at System.Threading.Tasks.Task.Execute () [0x00010] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 
> -- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
> at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
> at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
> at Xamarin.Forms.Maps.Android.GeocoderBackend+<GetAddressesForPositionAsync>d__2.MoveNext () [0x0007b] in <5896bb5ac9e44f69949788ed0017e7c5>:0
> --- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
> at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
> at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
> at D7MobileMain.ViewModels.MeterReadingsViewModel+<GetCityFromCoordinatesAsync>d__14.MoveNext () [0x00069] in C:\\Projects\\DSI\\Dossier Systems\\Dossier 7\\Mobile UI\\v1.0\\D7MobileMain\\D7MobileMain\\D7MobileMain\\ViewModels\\MeterReadingsViewModel.cs:130
> --- End of managed Java.IO.IOException stack trace ---
> java.io.IOException: grpc failed
>   at android.location.Geocoder.getFromLocation(Geocoder.java:136)

These are my current version numbers:

>Xamarin.Forms == 2.3.4.270
>Xamarin.Forms.Maps == 2.3.4.270
>Android Support libs == 23.3.0
>GooglePlayServices (Base, Basement, Maps) == 29.0.0.1
Comment 1 Trevor Heins 2017-08-31 15:51:58 UTC
I just verified that the code works with an older version of Google Play Services on an LG G2 device. When I updated the Google Play Services, the code throws the same error.
Comment 2 Paul DiPietro [MSFT] 2017-08-31 16:23:13 UTC
Could you please upload a reproduction project when you get a chance?
Comment 3 Trevor Heins 2017-08-31 16:36:56 UTC
Code is in the CustomerMapPage: https://drive.google.com/open?id=0B8HRvK84f7gdNXlqUU1XTDV4X0U
Comment 4 Paul DiPietro [MSFT] 2017-12-04 19:07:12 UTC
I don't seem able to reproduce this with the latest 2.5.0 stable release of Forms on an S8 device. I might suggest checking your Xamarin.Android.Support library versions to make sure things are in order, and if you can reliably recreate the behavior on a smaller reproduction with 2.5.0, please reopen this with that project as well as verify exact device scenarios where the error occurs. Thanks!