get location fails on my Android 6.0

0
I’m using an old Android phone Samsung A5 2016 to do my testings. It’s about prototyping, i’m running studio pro and the “make it native” app. The problem is related to the device itself. My app has not changed, it’s still working on another phone ( my company phone, samsung a8 android 9), it has been working on this phone. The app is loading, and i can navigate. The “get location” activity of a nanoflow fails. Entering in text box makes it crash and reload. I have done a factory reset of the phone. Any idea of where to look at ?
asked
2 answers
0

It is probably something to do with your settings in the Get Current Location action.

It will throw an error when your device cannot return the location before the timeout. Make sure your app has location persmissions, and try setting Timeout and Maximum age to empty, and high accuracy to false, and then see if the error still occurs.

answered
0

Thanks for the reply.

The Get location is still failing despite your recommandations, but i’ve fixed the second problem.

EDIT : It’s still failing after a phone reboot, but if i run google maps in background, it works !

It’s like if the mendix app can’t get a new location, but can use the history of google maps.

EDIT2 : my workaround is to include a map widget in the page and set an history age not too low.

When it fails, the log file seems to be clean. 

09-09 09:41:05.581 19997 26779 I System.out: (HTTPLog)-Static: isSBSettingEnabled false
09-09 09:41:05.581 19997 26779 I System.out: (HTTPLog)-Static: isSBSettingEnabled false
09-09 09:41:05.581  2214  2752 D EnterpriseController: netId is 0
09-09 09:41:05.581  2214  2752 D Netd    : getNetworkForDns: using netid 503 for uid 10008
09-09 09:41:05.581 19997 26779 I qtaguid : Tagging socket 188 with tag 3000120300000000{805310979,0} uid -1, pid: 19997, getuid(): 10008
09-09 09:41:05.651  2778  4310 D EnterpriseDeviceManagerService: isManagedProfileUser(): userId = 0
09-09 09:41:05.651  2778  4597 D EnterpriseDeviceManagerService: isManagedProfileUser(): userId = 0
09-09 09:41:05.651  2778  4172 D EnterpriseDeviceManagerService: isManagedProfileUser(): userId = 0
09-09 09:41:05.661  2778  4333 D LocationManagerService: getLastLocation: Request[ACCURACY_FINE gps requested=0 fastest=0 num=1]
09-09 09:41:05.671  2778  3776 D LocationManagerService: request 3f2f2ef gps Request[ACCURACY_FINE gps requested=+100ms fastest=+100ms] from com.mendix.developerapp(10158)
09-09 09:41:05.671  2778  3776 D LocationManagerService: provider request: gps ProviderRequest[ON interval=+100ms]
09-09 09:41:05.671  2778  4175 D GpsLocationProvider: setRequest ProviderRequest[ON interval=+100ms]
09-09 09:41:05.671  2778  3776 I AppOps  : sendInfoToFLP, code=41 , uid=10158 , packageName=com.mendix.developerapp , type=startOp
09-09 09:41:05.671  2778  3776 I AppOps  : sendInfoToFLP, code=42 , uid=10158 , packageName=com.mendix.developerapp , type=startOp
09-09 09:41:05.671  2778  2789 I LocationManagerService: remove 3f2f2ef by com.mendix.developerapp
09-09 09:41:05.671  2778  2947 V BroadcastQueue: [background] Process cur broadcast BroadcastRecord{85071fc u0 android.intent.action.DROPBOX_ENTRY_ADDED qIdx=4}, state= (APP_RECEIVE) DELIVERED for app ProcessRecord{745ffab 26816:com.samsung.android.sm/1000}
09-09 09:41:05.681  2778  2789 I AppOps  : sendInfoToFLP, code=41 , uid=10158 , packageName=com.mendix.developerapp , type=finishOp
09-09 09:41:05.681  2778  2789 I AppOps  : sendInfoToFLP, code=42 , uid=10158 , packageName=com.mendix.developerapp , type=finishOp
09-09 09:41:05.681  2778  2789 D LocationManagerService: provider request: gps ProviderRequest[ON interval=+30m0s0ms]
09-09 09:41:05.681  2778  4175 D GpsLocationProvider: setRequest ProviderRequest[ON interval=+30m0s0ms]
09-09 09:41:05.681 25940 26121 E ReactNativeJS: Get location has failed  (message from the nanoflow in the error handling branch)

 

I have fixed the second problem where the app was crashing when i was editing a textbox. Just redesigning the page did the trick. i have caught the following error in the logs.

I suspect this was coming from the maps widget. When i enter in a textbox, the keyboard show up, resize the page, and try to resize the widget to 0. Moving the widget in a column and give it some space has solved the problem.

09-09 09:42:03.631 25940 27256 E AndroidRuntime: FATAL EXCEPTION: androidmapsapi-Snapshot
09-09 09:42:03.631 25940 27256 E AndroidRuntime: Process: com.mendix.developerapp, PID: 25940
09-09 09:42:03.631 25940 27256 E AndroidRuntime: java.lang.IllegalArgumentException: width and height must be > 0
09-09 09:42:03.631 25940 27256 E AndroidRuntime:     at android.graphics.Bitmap.createBitmap(Bitmap.java:967)
09-09 09:42:03.631 25940 27256 E AndroidRuntime:     at android.graphics.Bitmap.createBitmap(Bitmap.java:946)
09-09 09:42:03.631 25940 27256 E AndroidRuntime:     at android.graphics.Bitmap.createBitmap(Bitmap.java:913)
09-09 09:42:03.631 25940 27256 E AndroidRuntime:     at com.google.maps.api.android.lib6.impl.a.b(:com.google.android.gms.dynamite_mapsdynamite@203019047@20.30.19 (040308-0):2)
09-09 09:42:03.631 25940 27256 E AndroidRuntime:     at com.google.maps.api.android.lib6.impl.bf.run(:com.google.android.gms.dynamite_mapsdynamite@203019047@20.30.19 (040308-0):1)
09-09 09:42:03.631 25940 27256 E AndroidRuntime:     at java.lang.Thread.run(Thread.java:818)

 

Note : i got this logs by using logcat like described here : https://docs.mendix.com/howto/mobile/native-debug

 

answered