NativeScript / NativeScript/android-dts-generator
Importing dependencies for a .jar file
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 96
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
TLDR
How do I import all the dependencies required for a
jarfile I'm setting as input?
First I want to say, this repository is a game changer for debugging native Android plugins. I'm using it to see exactly what APIs are exposed to TypeScript for any .jar file.
For example, here's a gist of the BoltsFramework/Bolts-Android bolts.Task.d.ts.
I'm having an issue with dts-generator.jar and detecting dependentcies for the input jar file.
Example:
java -jar dts-generator.jar -input bolts-tasks-1.4.0.jar
Error:
Exception in thread "main" java.lang.NoClassDefFoundError: Couldn't find class: java.lang.Exception required by class: bolts.AggregateException. You need to provide the jar containing the missing class: java.lang.Exception
What I've been doing so far is adding android.jar from $ANDROID_HOME/platforms/android-23/android.jar and adding it to an input like so:
java -jar dts-generator.jar -input android.jar -input bolts-tasks-1.4.0.jar -generate-multiple
Which most of the time results in a working output of *.d.ts files.
Although sometimes for example,
java -jar dts-generator.jar -input android.jar -input OneSignalSDK.jar -generate-multiple
Errors
Exception in thread "main" java.lang.NoClassDefFoundError: Couldn't find class: com.amazon.device.messaging.ADMMessageHandlerBase required by class: com.onesignal.ADMMessageHandler. You need to provide the jar containing the missing class: com.amazon.device.messaging.ADMMessageHandlerBase
Since the android.jar file does not contain com.amazon.device classes.
How do I import all the dependencies required for a jar file I'm setting as input?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the documented commands with bolts-tasks-1.4.0.jar, android.jar, and OneSignalSDK.jar, noting where dependency lookup fails. Trace the command-line handling of repeated -input arguments in dts-generator.jar and define done as resolving required classes without manually adding every dependency jar.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, typescript
- Domain
- mobile-dev, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100