Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nativescript 7 Error #270

Open
gregersen79 opened this issue Sep 9, 2020 · 11 comments
Open

Nativescript 7 Error #270

gregersen79 opened this issue Sep 9, 2020 · 11 comments

Comments

@gregersen79
Copy link

gregersen79 commented Sep 9, 2020

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<…>

@gregersen79 gregersen79 changed the title Nativescript 7 support Nativescript 7 Error Sep 9, 2020
@msaravitz
Copy link

I'm having the same issue, have you found any workaround for now?

@mreall
Copy link

mreall commented Sep 23, 2020

Has anyone figured out a workaround?

@msaravitz
Copy link

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.

@3rror404
Copy link

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.

@mreall
Copy link

mreall commented Sep 28, 2020

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.

  1. Forked @nativescript/plugins and cloned the repo locally.
  2. In the local repo, ran npm setup to initialize the packages.
  3. Commented out line 254 of packages/background-http/index.ios.ts.
  4. Ran npm start and selected @nativescript.background-http.build to build the package.
  5. 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).

mreall pushed a commit to mreall/plugins that referenced this issue Sep 28, 2020
@3rror404
Copy link

A major problem with this change is that you lose the ability to monitor progress with task.upload and task.totalUpload.

@andreasteffanoni
Copy link

Same issue. Thanks @3rror404, your workaround worked for me as well.

@benediktveith
Copy link

+1

@3rror404
Copy link

3rror404 commented Sep 30, 2020

There is a PR that is working great for me on iOS.

NativeScript/plugins#16

@JWiseCoder
Copy link

I'm also having this issue.

@luiguild
Copy link

For me in Android and iOS, using NS7 and 5.0.1 version and not working at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants