nativescript-background-http
nativescript-background-http copied to clipboard
Nativescript 7 Error
Only testet on iOS @nativescript/ios": "7.0.0".
Please, provide the following version numbers that your issue occurs with:
- CLI: 7.0.4
- Cross-platform modules: 7.0.0
- Runtime(s): @nativescript/ios": "7.0.0"
When I upload a file, I get the error below. The file gets uploaded correct though.
***** Fatal JavaScript exception - application has been terminated. ***** NativeScript encountered a fatal error: Uncaught Error: -[NSInvocation getArgument:atIndex:]: NULL address argument at readProp(file: node_modules/@nativescript/background-http/index.ios.js:218:0) at get upload(file: node_modules/@nativescript/background-http/index.ios.js:235:0) at onProgress(file: node_modules/@nativescript/background-http/index.ios.js:7:0) at (file: node_modules/@nativescript/background-http/index.ios.js:78:0) (CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught Error: -[NSInvocation getArgument:atIndex:]: NULL address argument at readProp(file: node_modules/@nativescript/background-http/index.ios.js:218:0) at get upload(file: node_modules/@nativescript/background-http/index.ios.js:235:0) at onProgress(file: node_modules/@nativescript/background-http/index.ios.js:7:0) at (file: node_modules/@nativescript/background-http/index.ios.js:78:0) ', reason: '(null)' *** First throw call stack: ( 0 CoreFoundation 0x00007fff2043a11e __exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007fff20177f78 objc_exception_throw + 48 2 NativeScript 0x00000001054802b4 _ZN3tns21NativeScriptException15OnUncaughtErrorEN2v85LocalINS1_7MessageEEENS2_INS1_5ValueEEE + 882 3 NativeScript 0x00000001058ad668 _ZN2v88internal14MessageHandler25ReportMessageNoExceptionsEPNS0_7IsolateEPKNS0_15MessageLocationENS0_6HandleINS0_6ObjectEEENS_5LocalINS_5ValueEEE + 344 4 NativeScript 0x00000001058ad4c9 _ZN2v88internal14MessageHandl<…>
I'm having the same issue, have you found any workaround for now?
Has anyone figured out a workaround?
Has anyone figured out a workaround?
I commented out the offending code in the readProp function and that has been working so far. Though I believe you will lose the upload progress tracking.
Commenting line 254 of index.ios.ts / line 220 of index.ios.js prevents the crash:
invocation.getReturnValue(ret);
I'm still receiving the progress
and complete
events with the line removed on iOS 14. I haven't tested elsewhere yet.
Thanks @3rror404, that worked for me. For anyone else fairly new to manually updating plugins and wants to fix this while waiting for the official update, here's what I did. Let me know if there's a better process.
- Forked @nativescript/plugins and cloned the repo locally.
- In the local repo, ran
npm setup
to initialize the packages. - Commented out line 254 of packages/background-http/index.ios.ts.
- Ran
npm start
and selected@nativescript.background-http.build
to build the package. - From my NS 7 project, ran
ns plugin add ../ns-plugins/plugins/dist/packages/background-http
to add the modified plugin to my app (of course you'll need to replace the path with the path on your local machine).
A major problem with this change is that you lose the ability to monitor progress with task.upload
and task.totalUpload
.
Same issue. Thanks @3rror404, your workaround worked for me as well.
+1
I'm also having this issue.
For me in Android and iOS, using NS7 and 5.0.1 version and not working at all