triniwiz / nativescript-videorecorder

:video_camera: NativeScript plugin for Video Recording . :video_camera:
Apache License 2.0
43 stars 29 forks source link

Permissions error when only one permission given #44

Closed FarruchKouliev closed 6 years ago

FarruchKouliev commented 6 years ago

Make sure to check the demo app(s) for sample usage

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital letter.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

1) Allow permissions for camera + audio 2) Close app 2) Decline persmissions for camera in emulator 3) Open app again 4) Click on allow camera permissions 5) Error

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=3001, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {org.nativescript.Gymtition/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: 
Calling js method onRequestPermissionsResult failed

Error: java.lang.ArrayIndexOutOfBoundsException: int[] offset=1 length=1 src.length=1
    com.tns.Runtime.callJSMethodNative(Native Method)
    com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
    com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
    com.tns.Runtime.callJSMethod(Runtime.java:957)
    com.tns.Runtime.callJSMethod(Runtime.java:941)
    com.tns.Runtime.callJSMethod(Runtime.java:933)
    com.tns.NativeScriptActivity.onRequestPermissionsResult(NativeScriptActivity.java:67)
    android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7388)
    android.app.Activity.dispatchActivityResult(Activity.java:7239)
    android.app.ActivityThread.deliverResults(ActivityThread.java:4320)
    android.app.ActivityThread.handleSendResult(ActivityThread.java:4367)
    android.app.ActivityThread.-wrap19(Unknown Source:0)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
    android.os.Handler.dispatchMessage(Handler.java:105)
    android.os.Looper.loop(Looper.java:164)
    android.app.ActivityThread.main(ActivityThread.java:6541)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
File: "file:///data/data/org.nativescript.Gymtition/files/app/tns_modules/nativescript-videorecorder/advanced/advanced-video-view.js, line: 25, column: 103

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.Gymtition/files/app/tns_modules/nativescript-videorecorder/advanced/advanced-video-view.js', line: 25, column: 104
    Frame: function:'Observable.notify', file:'file:///data/data/org.nativescript.Gymtition/files/app/tns_modules/tns-core-modules/data/observable/observable.js', line: 103, column: 23
    Frame: function:'ActivityCallbacksImplementation.onRequestPermissionsResult', file:'file:///data/data/org.nativescript.Gymtition/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 704, column: 29
    Frame: function:'NativeScriptActivity.onRequestPermissionsResult', file:'file:///data/data/org.nativescript.Gymtition/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 42, column: 25

    at android.app.ActivityThread.deliverResults(ActivityThread.java:4324)
    at android.app.ActivityThread.handleSendResult(ActivityThread.java:4367)
    at android.app.ActivityThread.-wrap19(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: com.tns.NativeScriptException: 
Calling js method onRequestPermissionsResult failed

Error: java.lang.ArrayIndexOutOfBoundsException: int[] offset=1 length=1 src.length=1
    com.tns.Runtime.callJSMethodNative(Native Method)
    com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
    com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
    com.tns.Runtime.callJSMethod(Runtime.java:957)
    com.tns.Runtime.callJSMethod(Runtime.java:941)
    com.tns.Runtime.callJSMethod(Runtime.java:933)
    com.tns.NativeScriptActivity.onRequestPermissionsResult(NativeScriptActivity.java:67)
    android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7388)
    android.app.Activity.dispatchActivityResult(Activity.java:7239)
    android.app.ActivityThread.deliverResults(ActivityThread.java:4320)
    android.app.ActivityThread.handleSendResult(ActivityThread.java:4367)
    android.app.ActivityThread.-wrap19(Unknown Source:0)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
    android.os.Handler.dispatchMessage(Handler.java:105)
    android.os.Looper.loop(Looper.java:164)
    android.app.ActivityThread.main(ActivityThread.java:6541)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
File: "file:///data/data/org.nativescript.Gymtition/files/app/tns_modules/nativescript-videorecorder/advanced/advanced-video-view.js, line: 25, column: 103

StackTrace: 
    Frame: function:'', file:'file:///data/data/org.nativescript.Gymtition/files/app/tns_modules/nativescript-videorecorder/advanced/advanced-video-view.js', line: 25, column: 104
    Frame: function:'Observable.notify', file:'file:///data/data/org.nativescript.Gymtition/files/app/tns_modules/tns-core-modules/data/observable/observable.js', line: 103, column: 23
    Frame: function:'ActivityCallbacksImplementation.onRequestPermissionsResult', file:'file:///data/data/org.nativescript.Gymtition/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 704, column: 29
    Frame: function:'NativeScriptActivity.onRequestPermissionsResult', file:'file:///data/data/org.nativescript.Gymtition/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 42, column: 25

    at com.tns.Runtime.callJSMethodNative(Native Method)
    at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
    at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
    at com.tns.Runtime.callJSMethod(Runtime.java:957)
    at com.tns.Runtime.callJSMethod(Runtime.java:941)
    at com.tns.Runtime.callJSMethod(Runtime.java:933)
    at com.tns.NativeScriptActivity.onRequestPermissionsResult(NativeScriptActivity.java:67)
    at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7388)
    at android.app.Activity.dispatchActivityResult(Activity.java:7239)
    at android.app.ActivityThread.deliverResults(ActivityThread.java:4320)
    ... 9 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: int[] offset=1 length=1 src.length=1
    ... 19 more
triniwiz commented 6 years ago

Fixed in the latest release 👍