stgrosshh / tipermissions

Titanium Modul for handling of Android permissions
Other
11 stars 5 forks source link

No virtual method registerPermissionRequestCallback error #2

Closed ardiwine closed 8 years ago

ardiwine commented 8 years ago

I tested this module using Ti SDK 5.2.2

This is the code that I was trying to run:

var tipermissions = require('ti.permissions');
    tipermissions.requestPermission("android.permission.CAMERA",123,function(e) {
    Ti.API.log("error","In callback " + e.success + " " + e.code + " " + e.requestCode);
});

and I got this runtime error:

[ERROR] :  TiExceptionHandler: (main) [35,301] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [0,301] - In alloy/controllers/index.js:21,23
[ERROR] :  TiExceptionHandler: (main) [0,301] - Message: Uncaught Error: No virtual method registerPermissionRequestCallback(Ljava/lang/Integer;Lorg/appcelerator/kroll/KrollFunction;Lorg/appcelerator/kroll/KrollObject;[Ljava/lang/String;)V in class Lorg/appcelerator/titanium/TiBaseActivity; or its super classes (declaration of 'org.appcelerator.titanium.TiBaseActivity' appears in /data/app/....apk)
[ERROR] :  TiExceptionHandler: (main) [0,301] - Source:         tipermissions.requestPermission("android.permission.CAMERA", 123, func
[ERROR] :  V8Exception: Exception occurred at alloy/controllers/index.js:21: Uncaught Error: No virtual method registerPermissionRequestCallback(Ljava/lang/Integer;Lorg/appcelerator/kroll/KrollFunction;Lorg/appcelerator/kroll/KrollObject;[Ljava/lang/String;)V in class Lorg/appcelerator/titanium/TiBaseActivity; or its super classes (declaration of 'org.appcelerator.titanium.TiBaseActivity' appears in ...

And I used this version: ti.permissions-android-0.5.zip

Do you know what I may have done incorrectly?

stgrosshh commented 8 years ago

The module requires a patched Ti SDK at the moment. A 5.2.0 patched version is provided with the module. The corresponding PR should be integrated in the official 5.4.0 version of the Ti SDK. So currently you either have to use the patched 5.2.0 version or wait until 5.4.0 is released.

Cheers Stefan

stgrosshh commented 8 years ago

After digging a little bit in the 5.4.0 source, I found that I'm forced to abandon this module. See Readme of the latest commit. Sorry for that.