Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameter type problem in NativeScript

See original GitHub issue


I am trying to implement this library for NativeScript but it can’t extracted metadata for Boolean parameter type.

We tried to implement it using Java reflection like here:

but not working for this method collectDeviceData(boolean collectDeviceData) :

let collectDeviceDataMethod = dropInRequest.getClass().getMethod("collectDeviceData", [java.lang.Boolean.class]);
collectDeviceDataMethod.invoke(dropInRequest, [true]);


Error: java.lang.NoSuchMethodException: collectDeviceData [class java.lang.Boolean]
    com.tns.Runtime.callJSMethodNative(Native Method)
    java.lang.reflect.Method.invoke(Native Method)$
File: "file:///data/data/org.nativescript.demo/files/app/tns_modules/nativescript-braintree/braintree.js, line: 25, column: 63

It can’t understand boolean type. It would be better if it is “java.lang.Boolean.class

Anyone have suggestion? Thanks in advance.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

jibon57commented, Sep 22, 2017

@sdcoffey Thanks for reply. Yes, the trick is working fine but the guy who solved the problem already mentioned that the trick is dirty. But works for me 😃. I have started a new project here:

Still now everything looks good 😃

sdcoffeycommented, Sep 22, 2017


It is indeed a dirty trick, but if it’s working for you, that’s the best we can do from this end unforch. Good luck!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Argument of type Event is not assignable to parameter of type ...
The error indicates that there is a mixup between the event name and the function's expected parameter type. If you want to use...
Read more >
Troubleshooting - NativeScript Docs
Problem : Calling native functions having SIMD vector return type and/or arguments on i386 and armv7 architectures crashes or returns garbage.
Read more >
Advanced Concepts - NativeScript Docs
The most common data type in Objective-C by far is the class. Classes can have instance or static ... If we want to...
Read more >
Runtime Types - NativeScript Docs
You can create new block types, passing the return type and parameter types as arguments. ... If you see an area for improvement...
Read more >
Background HTTP - NativeScript docs
The id is passed as a parameter when creating the session (the image-upload ... Usually this is not a problem - e.g. if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found