NativeScript / android-dts-generator

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

Error in generated .d.ts file #20

Closed sarvagayatri closed 6 years ago

sarvagayatri commented 7 years ago

I generated d.ts file for java.util, and paytm android sdk, both giving few errors in the file

app/item/android.d.ts(18,8): error TS2300: Duplicate identifier 'javalangThrowable'.

app/item/android.d.ts(18,28): error TS2503: Cannot find namespace 'java'.

app/item/android.d.ts(133,22): error TS2503: Cannot find namespace 'java'. app/item/android.d.ts(153,26): error TS2503: Cannot find namespace 'android'. app/item/android.d.ts(154,30): error TS2503: Cannot find namespace 'android'. app/item/android.d.ts(155,35): error TS2503: Cannot find namespace 'android'. app/item/android.d.ts(181,32): error TS2503: Cannot find namespace 'android'.

app/item/android.d.ts(283,24): error TS2503: Cannot find namespace 'java'. app/item/android.d.ts(284,29): error TS2503: Cannot find namespace 'java'. app/item/android.d.ts(340,28): error TS2503: Cannot find namespace 'java'. app/item/android.d.ts(362,31): error TS2503: Cannot find namespace 'android'. app/item/android.d.ts(363,32): error TS2503: Cannot find namespace 'android'. app/item/android.d.ts(364,39): error TS2503: Cannot find namespace 'android'. app/item/android.d.ts(365,33): error TS2503: Cannot find namespace 'android'. app/item/items.component.ts(113,24): error TS2339: Property 'java' does not exist on type 'typeof com'.

app/item/java-util/java.util.d.ts(2,8): error TS2300: Duplicate identifier 'javalangThrowable'.

app/item/java-util/java.util.d.ts(2,28): error TS2503: Cannot find namespace 'java'. app/item/java-util/java.util.d.ts(16,28): error TS2503: Cannot find namespace 'java'. app/item/java-util/java.util.d.ts(69,22): error TS2503: Cannot find namespace 'java'. app/item/java-util/java.util.d.ts(85,25): error TS2503: Cannot find namespace 'java'. app/item/java-util/java.util.d.ts(86,29): error TS2503: Cannot find namespace 'java'. app/item/java-util/java.util.d.ts(106,29): error TS2503: Cannot find namespace 'java'. app/item/java-util/java.util.d.ts(107,28): error TS2503: Cannot find namespace 'java'.

app/item/java-util/java.util.d.ts(108,29): error TS2503: Cannot find namespace 'java'.

TypeScript compiler failed with exit code 1

mast3rd3mon commented 5 years ago

what is the actual fix for this? i am having the same issue when i try to use this tool

vtrifonov commented 5 years ago

@mast3rd3mon are you using the latest version of the tool? Can you provide what typings you are trying to generate (and what arguments you're passing) in order to reproduce the issue?

mast3rd3mon commented 5 years ago

yeah i am using the latest, im trying to generate the typings for the zebra emdk. i managed to sort my issue by ignoring the smaller generated file and using the one from tns-platform-declarations