0

Basically the app I work on is for people in Saudi Arabia. It can search location in any language.

I'm trying location خاورمیانه, Road No 1018, Hidd, Bahrain text in autocompletetextview but I get the IllegalStateExceptionbut exception below.

Here is the error log exception:

     06-27 10:49:45.232 10440-10440/jaja.blackbean E/AndroidRuntime: FATAL EXCEPTION: main
     Process: jaja.blackbean, PID: 10440
     java.lang.IllegalStateException
     at com.google.android.gms.common.internal.zzac.zzar(Unknown Source)
     at com.google.android.gms.common.data.zzc.zzcA(Unknown Source)
     at com.google.android.gms.common.data.zzc.<init>(Unknown Source)
     at com.google.android.gms.location.places.internal.zzab.<init>(Unknown Source)
     at com.google.android.gms.location.places.internal.zzy.<init>(Unknown Source)
     at com.google.android.gms.location.places.PlaceBuffer.get(Unknown Source)
     at jaja.blackbean.activity.FruitJuiceFragment$6.onResult(FruitJuiceFragment.java:463)
     at jaja.blackbean.activity.FruitJuiceFragment$6.onResult(FruitJuiceFragment.java:452)
     at com.google.android.gms.internal.zzzx$zza.zzb(Unknown Source)
     at com.google.android.gms.internal.zzzx$zza.handleMessage(Unknown Source)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:145)
     at android.app.ActivityThread.main(ActivityThread.java:5942)
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Bruno Bieri
  • 9,724
  • 11
  • 63
  • 92
  • Cloud add the code for what you do in autocomplete, please. – Bruno Bieri Jun 27 '17 at 05:55
  • basically this app for Saudi peoples they can search location in any language – Sumit Kumawat Jun 27 '17 at 06:03
  • basically this app for Saudi peoples they can search location in any language I'm trying location خاورمیانه, Road No 1018, Hidd, Bahrain but I got below exception – Sumit Kumawat Jun 27 '17 at 06:11
  • First, you can edit a comment for 5 minutes. No need to write two comments in a row. Second, in order to help you it would be helpful if you can provide the code which causes this exception. Third I've updated your question with the information given in your second comment. Fourth, does it work without the text: خاورمیانه ? – Bruno Bieri Jun 27 '17 at 06:12
  • Maybe this answer solves your problem. https://stackoverflow.com/a/36414508/1306012 – Bruno Bieri Jun 27 '17 at 09:24

1 Answers1

0

It's hard to tell for sure without more info on exactly what your app is doing, but this error could be caused by calling PlaceBuffer.get() with an out-of-range index (either < 0 or >= size).

AndrewR
  • 10,759
  • 10
  • 45
  • 56
  • in my app showing autocomplete text in which my default showing the current location if the user wants to edit the location then he can. so according to the location showing the products lists but the app is a crash when a user put the English text plus Arabic text – Sumit Kumawat Jun 28 '17 at 07:26
  • What's happening is that the getPlaceById() lookup for the place ID returned in the autocomplete result for that query is returning no results. I suspect your code isn't checking for this and calling PlaceBuffer.get(0) on an empty list. – AndrewR Jun 29 '17 at 01:16
  • hello still I'm suffering to this issues but for this location(Road No 1018, Hidd, Bahrain خاورمیانه) app is a crash because of Address addresses = geocoder.getFromLocationName(mAddressOutput, 1); i got address size is 0 so please suggest what i do for this. i stuck to this problem – Sumit Kumawat Jul 03 '17 at 12:52
  • https://stackoverflow.com/questions/30659832/fail-to-obtain-specific-place-from-placebuffer same think is happen with me – Sumit Kumawat Jul 03 '17 at 13:29