Open roblav96 opened 8 years ago
Hey @roblav96
We have just released NativeScript 2.3 - can you check if you still reproduce this error at your side after the update.
just upgraded to 2.3 and get this
ONSOLE LOG file:///app/tns_modules/globals/globals.js:119:20: Border is deprecated 2016-09-25 19:40:46.595 sampleImageUpload[824:302530] * JavaScript call stack: ( 0 uploadTaskWithRequestFromFile@[native code] 1 uploadFile@file:///app/tns_modules/nativescript-background-http/background-http.js:102:60 2 sendImages@file:///app/main-page.js:76:34 3 @file:///app/main-page.js:106:49 4 forEach@:1:11 5 @file:///app/main-page.js:105:21 6 promiseReactionJob@:1:11 7 UIApplicationMain@[native code] 8 start@file:///app/tns_modules/application/application.js:233:26 9 anonymous@file:///app/app.js:2:18 10 evaluate@[native code] 11 moduleEvaluation@:1:11 12 @:8:48 13 promiseReactionJob@:1:11 ) 2016-09-25 19:40:46.595 sampleImageUpload[824:302530] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot read file at file:///var/mobile/Media/DCIM/101APPLE/IMG_1911.JPG' *\ First throw call stack: (0x1831e2db0 0x182847f80 0x1838464c0 0x183847338 0x1838471ec 0x1838466ec 0x182c2d47c 0x182c38728 0x18384664c 0x18384714c 0x100874044 0x100872a28 0x100872540 0x10036067c 0x10064fde8 0x100656368 0x100656378 0x100656378 0x100656378 0x100656378 0x100656378 0x1006506c8 0x1005fceb0 0x1005e284c 0x1007769bc 0x100368cc0 0x100367d54 0x18319909c 0x183198b30 0x183196830 0x1830c0c50 0x1849a8088 0x1883ae088 0x100874044 0x100872a28 0x100872540 0x10036067c 0x10064fde8 0x100656368 0x100656378 0x1006506c8 0x1005fceb0 0x1005e284c 0x10070d93c 0x10037181c 0x1007f944c 0x100656c64 0x100656378 0x100656378 0x100656378 0x1006506c8 0x1005fceb0 0x1005e284c 0x1007769bc 0x100368cc0 0x1003a13f8 0x100009434 0x182c5e8b8) libc++abi.dylib: terminating with uncaught exception of type NSException ^C%
Hey, I'm experiencing the same family of problems. The error above is basically saying that the application is unable to access the image in that folder. Apperently iOS does not pemit application to use files from outside their folder. Unfortunately I am yet to find a solution. I've been trying to reproduce This solution in nativescript but I haven't quite gotten it yet.
I resolved this personally.
The image picker's selected object has a getImage function that returns a Promise with an ImageSource... ImageSource has a saveToFile method.
Here's what I did. https://github.com/Mofusion/sample-ImageUpload
Thanks a lot sir. That is exactly what I needed. I wonder why they didn't use that in the official one?
Terminal
Error