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

Importing dependencies for a .jar file #8

Open
roblav96 opened this issue Aug 28, 2016 · 1 comment
Open

Importing dependencies for a .jar file #8

roblav96 opened this issue Aug 28, 2016 · 1 comment

Comments

@roblav96
Copy link
Contributor

roblav96 commented Aug 28, 2016

TLDR

How do I import all the dependencies required for a jar file 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?

@roblav96
Copy link
Contributor Author

roblav96 commented Aug 28, 2016

It seems like I need to modify the Java Build Path as described here.

Is there a way I can always set -input android-support-v13.jar and -input android.jar for every jar?

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

1 participant