NativeScript / android-dts-generator

A tool that generates TypeScript declaration files (.d.ts) from Jars
90 stars 22 forks source link

DtsApi.getInterfaces - Exception in thread "main" java.lang.NullPointerException #13

Open roblav96 opened 7 years ago

roblav96 commented 7 years ago

This happens with only a few jar files, but I get this error when throwing them through the dts-generator:

Exception in thread "main" java.lang.NullPointerException
    at com.telerik.dts.DtsApi.getInterfaces(DtsApi.java:352)
    at com.telerik.dts.DtsApi.generateDtsContent(DtsApi.java:75)
    at com.telerik.dts.Generator.generateDts(Generator.java:37)
    at com.telerik.dts.Generator.start(Generator.java:29)
    at com.telerik.Main.main(Main.java:21)

I've found that adding a check if clazz1 != null allows the generator to work. JavaClass clazz1 = ClassRepo.findClass(intface); The fix source: https://github.com/roblav96/android-dts-generator/commit/1dae5329050ca198977102400cd2a14588f840af#diff-84b371273f2d411517c3ef4981518716

Jar Examples

Download jars here: https://drive.google.com/file/d/0BzsNfWSNiUKLRlNOWkctb1JvZ1E/view?usp=sharing

OneSignal

java -jar dts-generator-debug.jar \
-input android24.jar \
-input android-support-v4.jar \
-input android-support-v7-appcompat.jar \
-input amazon-device-messaging-1.0.1.jar \
-input OneSignalSDK.jar \
-generate-multiple

materialdrawer

java -jar dts-generator.jar \
-input android24.jar \
-input android-support-v4.jar \
-input android-support-v7-appcompat.jar \
-input android-support-v7-recyclerview.jar \
-input materialize-1.0.0.jar \
-input materialdrawer-5.7.0.jar \
-generate-multiple
gizmo385 commented 6 years ago

Are there any updates on this issue? It is still happening in the current version. @roblav96

roblav96 commented 6 years ago

@gizmo385 checkout this repo of a presentation i did at ns dev day 2017 in nyc. itll walk you through how to generate android dts files

https://github.com/roblav96/nativescript-devday2017