Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6403] Ti.Geolocation.hasLocationPermissions() is undefined

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2019-10-21T15:20:40.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsAppcelerator CLI, Appcelerator Modules
Labelsandroid, geolocation, permissions, sdk-8
ReporterPietro Granati
AssigneeYordan Banev
Created2019-10-11T10:50:12.000+0000
Updated2019-10-21T15:20:40.000+0000

Description

This happens on Android I've updated my app from SDK 7.5.0 to SDK 8.2.0 Ti.Geolocation.hasLocationPermissions(Titanium.Geolocation.AUTHORIZATION_WHEN_IN_USE) returns undefined instead of true/false. It has been working for years. If I create a fresh app with just this request and SDK 8.2.0 everything works. I'm trying to find which modules causes this. I've these modules added:
dk.napp.drawer
ti.cloud
com.drtech.altbeacon
bencoding.android.tools
ti.nfc
ti.paint
ti.map
com.rkam.swiperefreshlayout
ro.mihaiblaga.imei
ti.barcode
yy.logcatcher
ti.animation
ti.identity
org.iotashan.TiTouchImageView
Tested with 8.2.1.v20191010112656 undefined still present Update: I've rolled back to 7.5.1 to going on with the development but now it crashes
[ERROR] :  TiExceptionHandler: (main) [640,1333] /alloy/controllers/index.js:1351
[ERROR] :  TiExceptionHandler:         gps_autorizzato: Ti.Geolocation.locationServicesAuthorization == Ti.Geolocation.AUTHORIZATION_DENIED ? false : true } });
[ERROR] :  TiExceptionHandler:                                         ^
[ERROR] :  TiExceptionHandler: TypeError: Cannot read property 'locationServicesAuthorization' of undefined
Update 2, using 8.2.0 I saw that throws an error:
[ERROR] :  V8Exception: Exception occurred at /alloy/controllers/index.js:3526: Uncaught Error: Attempt to invoke virtual method 'boolean ti.modules.titanium.geolocation.TiLocation.isProvider(java.lang.String)' on a null object reference
Update 3 and Fix! Thank to Yordan we found that I was using ti.playservices 16.1.15 that causes all that trouble

Attachments

FileDateSize
appc_info_20191014.txt2019-10-14T09:38:40.000+000021379

Comments

  1. Jorge Giunta 2019-10-14

    Hello, on iOS with SDK 8.2.0 with permission granted on my device:
       Ti.API.info(Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_WHEN_IN_USE));
       
    I get on log: [ERROR] Script Error { [ERROR] column = 54; [ERROR] line = 1449; [ERROR] message = "undefined is not an object"; When I downgrade to 8.1.0.GA all works like a charm.
  2. Motiur Rahman 2019-10-21

    [~jgiunta], If you use ti.playservices module then try to change the version to fix this issue. Thanks!

JSON Source