Input.location.Start() causes android build to crash directly after startup

Hello! I upgraded to Unity 5.5 today with the release, and I tried to build something I’ve been working on to android (as i’ve done before in older versions) and it builds fine, and the app launches, however after the the game shows for about half a second, the game crashes completely.

I commented out Input.location.Start() and the app works fine :o

Here is some adb logcat stuff about it where the errors start:

Thanks for any help on how to workaorund this!

Getting this too in 5.5

1 Like

Good to know it’s not just me! Hopefully this gets some attention

Same here. My app is working great in the previous version. After updated to 5.5, my app crashes when Input.location starts.

1 Like

We have a bug logged for this now: Unity Issue Tracker - [Android] Location app crashes due to error 'jstring has wrong type: android.location.Location'

It is assigned to the development team responsible for the area.

Dan
Unity Support

1 Like

Huh. Note to self: Don’t upgrade to 5.5. My current projects core functionality is geolocation based.

1 Like

Getting same thing here once we upgraded to 5.5. Any work arounds or alternate ways to get compass heading?

I am getting this also. Our team upgraded to 5.5 today and we spent the day trying to figure out why our app crashes on Android. Narrowed it down to this…

:frowning:

Same here, Android 6.0 on OnePlus3 crashes after Input.location.Start().

Has anyone found a workaround?

Logcat output:

12-09 07:41:08.374 17876-17890/? D/LocationManager: requestLocationUpdates listener=<native proxy object> packageName= com.example
12-09 07:41:08.376 1328-2675/? E/LocationManagerService: requestLocationUpdates: uid=10102, pid=17876, provider=network, package=com.example listener= android.location.ILocationListener$Stub$Proxy@71281eb intent= null
12-09 07:41:08.377 17876-17890/? D/LocationManager: requestLocationUpdates listener=<native proxy object> packageName= com.example
12-09 07:41:08.378 1328-1359/? E/LocationManagerService: requestLocationUpdates: uid=10102, pid=17876, provider=passive, package=com.example listener= android.location.ILocationListener$Stub$Proxy@950bde1 intent= null
12-09 07:41:10.346 17876-17890/? A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x13212000 in tid 17890 (UnityMain)
12-09 07:41:10.455 712-712/? A/DEBUG: pid: 17876, tid: 17890, name: UnityMain  >>> com.example <<<
12-09 07:41:10.497 712-712/? A/DEBUG:     #02 pc 0099ca88  /data/app/com.example-1/lib/arm/libunity.so
12-09 07:41:10.884 1328-17981/? W/ActivityManager:   Force finishing activity com.example/com.unity3d.player.UnityPlayerActivity

Prism*, please vote: Unity Issue Tracker - [Android] Location app crashes due to error &#39;jstring has wrong type: android.location.Location&#39;

Workaround - downgrade unity version

I tried to downgrade and now my project UI elements are all broken. No idea how to fix :frowning:

BE CAREFUL: If you update your project to 5.5, you can’t downgrade to <5.5 because all the UI elements will be broken. Make a backup first.

1 Like

You should have a backup before every upgrade.

Use version control people!

3 Likes

And this issue not fixed in latest 5.6 version

Just ran into this error. Whenever starting the location services I have around a 70% chance of the app crashing upon a restart and 10% chance if I open from a fresh install.

I’m going to try GPS systems in the Android and native plugins I bought until this is resolved. https://www.assetstore.unity3d.com/en/#!/content/67473

I’ll update you guys on the outcome. Hopefully this stops crashing, I just need to find a general proximity of the user. City at max but within a 600 meter range would be preferable. I am also just pinging for the location once upon authentication.

[EDIT]: The asset plugin works perfectly fine! No crashes but only for android. I wouldn’t doubt it if there was another plugin for iOS but android is my only target platform right now.

Ho no, I create my project with 5.5, downgrade won’t be easy …

Try calling Input.location.Stop (); before calling again Input.location.Start ();