You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Android 9
but so far only on Huawei P30 Pro and Samsung S10
Please, provide the following version numbers that your issue occurs with:
$ tns info
✔ Getting NativeScript components versions information...
✔ Component nativescript has 5.3.4 version and is up to date.
✔ Component tns-core-modules has 5.3.2 version and is up to date.
✔ Component tns-android has 5.3.1 version and is up to date.
✔ Component tns-ios has 5.3.1 version and is up to date.
"nativescript-camera": "^4.4.1",
Please, tell us how to recreate the issue in as much detail as possible.
Try to take a picture using
Samsung Galaxy S10 (Android 9)
Huawei P30 Pro (Android 9)
Same code works on
Google Pixel 3 (Android 9)
Samsung Galaxy S9 (Android 8)
Samsung Galaxy A7 (Android 8)
Samsung Galaxy A6+ (Android 8)
Is there any code involved?
camera.requestPermissions()
.then(() => {
const options: CameraOptions = {
width: this.imageSize,
height: this.imageSize,
cameraFacing: 'front',
allowsEditing: true,
keepAspectRatio: true
};
camera.takePicture(options)
.then((imageAsset) => {
this.saveImageToBackend(imageAsset);
})
.catch((error) => {
console.error('Could not take picture: ' + error);
});
}, () => {
console.log('Not authorized to access camera on device.');
});
Stacktrace:
System.err: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=3453, result=-1, data=null} to activity {my.app.App/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
System.err: Calling js method onActivityResult failed
System.err:
System.err: Error: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/NSIMG_20190514_20046.jpg (No such file or directory)
System.err: java.io.FileInputStream.open0(Native Method)
System.err: java.io.FileInputStream.open(FileInputStream.java:200)
System.err: java.io.FileInputStream.<init>(FileInputStream.java:150)
System.err: java.io.FileInputStream.<init>(FileInputStream.java:103)
System.err: android.media.ExifInterface.<init>(ExifInterface.java:1347)
System.err: com.tns.Runtime.callJSMethodNative(Native Method)
System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1203)
System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:1083)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:1070)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:1050)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:1042)
System.err: com.tns.NativeScriptActivity.onActivityResult(NativeScriptActivity.java:53)
System.err: android.app.Activity.dispatchActivityResult(Activity.java:7701)
System.err: android.app.ActivityThread.deliverResults(ActivityThread.java:5037)
System.err: android.app.ActivityThread.handleSendResult(ActivityThread.java:5084)
System.err: android.app.ActivityThread.-wrap20(Unknown Source:0)
System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
System.err: android.os.Handler.dispatchMessage(Handler.java:108)
System.err: android.os.Looper.loop(Looper.java:166)
System.err: android.app.ActivityThread.main(ActivityThread.java:7529)
System.err: java.lang.reflect.Method.invoke(Native Method)
System.err: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
System.err: File: "file:///data/data/my.app.App/files/app/vendor.js, line: 179142, column: 35
System.err:
System.err: StackTrace:
System.err: Frame: function:'', file:'file:///data/data/my.app.App/files/app/vendor.js', line: 179142, column: 36
System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify', file:'file:///data/data/my.app.App/files/app/vendor.js', line: 201922, column: 23
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.ActivityCallbacksImplementation.onActivityResult', file:'file:///data/data/my.app.App/files/app/vendor.js', line: 219903, column: 29
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/activity.js.NativeScriptActivity.onActivityResult', file:'file:///data/data/my.app.App/files/app/vendor.js', line: 217732, column: 25
System.err:
System.err: at android.app.ActivityThread.deliverResults(ActivityThread.java:5041)
System.err: at android.app.ActivityThread.handleSendResult(ActivityThread.java:5084)
System.err: at android.app.ActivityThread.-wrap20(Unknown Source:0)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
System.err: at android.os.Handler.dispatchMessage(Handler.java:108)
System.err: at android.os.Looper.loop(Looper.java:166)
System.err: at android.app.ActivityThread.main(ActivityThread.java:7529)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
System.err: Caused by: com.tns.NativeScriptException:
System.err: Calling js method onActivityResult failed
System.err:
System.err: Error: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/NSIMG_20190514_20046.jpg (No such file or directory)
System.err: java.io.FileInputStream.open0(Native Method)
System.err: java.io.FileInputStream.open(FileInputStream.java:200)
System.err: java.io.FileInputStream.<init>(FileInputStream.java:150)
System.err: java.io.FileInputStream.<init>(FileInputStream.java:103)
System.err: android.media.ExifInterface.<init>(ExifInterface.java:1347)
System.err: com.tns.Runtime.callJSMethodNative(Native Method)
System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1203)
System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:1083)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:1070)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:1050)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:1042)
System.err: com.tns.NativeScriptActivity.onActivityResult(NativeScriptActivity.java:53)
System.err: android.app.Activity.dispatchActivityResult(Activity.java:7701)
System.err: android.app.ActivityThread.deliverResults(ActivityThread.java:5037)
System.err: android.app.ActivityThread.handleSendResult(ActivityThread.java:5084)
System.err: android.app.ActivityThread.-wrap20(Unknown Source:0)
System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
System.err: android.os.Handler.dispatchMessage(Handler.java:108)
System.err: android.os.Looper.loop(Looper.java:166)
System.err: android.app.ActivityThread.main(ActivityThread.java:7529)
System.err: java.lang.reflect.Method.invoke(Native Method)
System.err: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
System.err: File: "file:///data/data/my.app.App/files/app/vendor.js, line: 179142, column: 35
System.err:
System.err: StackTrace:
System.err: Frame: function:'', file:'file:///data/data/my.app.App/files/app/vendor.js', line: 179142, column: 36
System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify', file:'file:///data/data/my.app.App/files/app/vendor.js', line: 201922, column: 23
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.ActivityCallbacksImplementation.onActivityResult', file:'file:///data/data/my.app.App/files/app/vendor.js', line: 219903, column: 29
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/activity.js.NativeScriptActivity.onActivityResult', file:'file:///data/data/my.app.App/files/app/vendor.js', line: 217732, column: 25
System.err:
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1203)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1083)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1070)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1050)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1042)
System.err: at com.tns.NativeScriptActivity.onActivityResult(NativeScriptActivity.java:53)
System.err: at android.app.Activity.dispatchActivityResult(Activity.java:7701)
System.err: at android.app.ActivityThread.deliverResults(ActivityThread.java:5037)
System.err: ... 9 more
System.err: Caused by: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/NSIMG_20190514_20046.jpg (No such file or directory)
System.err: at java.io.FileInputStream.open0(Native Method)
System.err: at java.io.FileInputStream.open(FileInputStream.java:200)
System.err: at java.io.FileInputStream.<init>(FileInputStream.java:150)
System.err: at java.io.FileInputStream.<init>(FileInputStream.java:103)
System.err: at android.media.ExifInterface.<init>(ExifInterface.java:1347)
System.err: ... 18 more
The text was updated successfully, but these errors were encountered:
After hours of testing all the different models above with a number of different CameraOptions, it seems like the one I didn't test was the one most obvious to test: saveToGallery: false
const options: CameraOptions = {
width: this.imageSize,
height: this.imageSize,
cameraFacing: 'front',
allowsEditing: true,
keepAspectRatio: true,
saveToGallery: false // <-- this did the trick
};
This seems to solve the issue on both the S10 and the P30 Pro.. So I have a workaround as I don't need to save it to the gallery, but someone else might need this functionality.
Which platform(s) does your issue occur on?
Android 9
but so far only on Huawei P30 Pro and Samsung S10
Please, provide the following version numbers that your issue occurs with:
$ tns info
✔ Getting NativeScript components versions information...
✔ Component nativescript has 5.3.4 version and is up to date.
✔ Component tns-core-modules has 5.3.2 version and is up to date.
✔ Component tns-android has 5.3.1 version and is up to date.
✔ Component tns-ios has 5.3.1 version and is up to date.
Please, tell us how to recreate the issue in as much detail as possible.
Try to take a picture using
Same code works on
Is there any code involved?
Stacktrace:
The text was updated successfully, but these errors were encountered: