android-dts-generator icon indicating copy to clipboard operation
android-dts-generator copied to clipboard

A tool that generates TypeScript declaration files (.d.ts) from Jars

Results 20 android-dts-generator issues
Sort by recently updated
recently updated
newest added

Updating definitions to arbitrary android sdk version

[{"_id":"6362da59ea01ec786e8264ad","body":"I've looked into generate.win.bat and created an equivalent for Linux (you'll find some extra needed jars there), copied the android.d.ts from output\/android-24 into the respective tns-platform-declarations folder, getting a lot less errors, now its mainly these two:\r\n\r\n```\r\nNamespace 'android' has no exported member 'content'.\r\nNamespace 'android' has no exported member 'view'.\r\n```\r\n\r\nbut org.nativescript.widgets.d.ts throws another bunch.\r\n\r\nEdit: the extra jars aren't on my system. No error was thrown however.","issue_id":1662082218433,"origin_id":297059824,"user_origin_id":11312895,"create_time":1493132692,"update_time":1493133005,"id":1667422809926,"updated_at":"2022-11-02T21:00:09.926000Z","created_at":"2022-11-02T21:00:09.926000Z"}] comment

I'm trying to update my tns-platform-declarations to use the latest android sdk. I've generated the definitions for the respective sdks and replaced the include in `tns-platform-declarations/android/android.d.ts` to use the generated...

Classes java.* do not include dots between them eg. javalangObject

[{"_id":"6362e91dd297b621323b7ca0","body":"@roblav96 does this cause TypeScript compiler errors? If it doesn't , then when using it it will appear as though `MediaType extends java.lang.Object` (which in fact it does), it is likely that `import javalangObject = java.lang.Object` is written somewhere in that file at an earlier point.\r\n\r\nThis is done to work around a TypeScript limitation [described here](http:\/\/stackoverflow.com\/questions\/40306611\/use-type-from-another-global-module-but-with-similar-submodule)","issue_id":1662082218436,"origin_id":271819812,"user_origin_id":10464986,"create_time":1484126858,"update_time":1484126858,"id":1667426589281,"updated_at":"2022-11-02T22:03:09.281000Z","created_at":"2022-11-02T22:03:09.281000Z"},{"_id":"6362e91dd297b621323b7ca1","body":"@Pip3r4o yes the `import javalangObject = java.lang.Object` is located elsewhere in the multiple declarations but then say I generate definitions for `com.bumptech.glide` I'll get duplicate declaration errors everywhere. Also I like to condense my declaration like how `ios` declarations are by running `cat declarations\/*.d.ts > combined\/com.bumptech.glide.d.ts` then I remove all the `ref helper=` because I've included the `android.17.d.ts` file.\r\n\r\nIt just seems that generating declarations for libraries are becoming more difficult to do.\r\n\r\nPlus my IDE `goto declaration` goes to the import and not the actual declaration.","issue_id":1662082218436,"origin_id":272007716,"user_origin_id":1457327,"create_time":1484171703,"update_time":1484171703,"id":1667426589286,"updated_at":"2022-11-02T22:03:09.285000Z","created_at":"2022-11-02T22:03:09.285000Z"},{"_id":"6362e91dd297b621323b7ca2","body":"@roblav96 From what I gather - you want to make the typings generation incremental, that it retains knowledge of previously generated typings, so that it won't make dupes. The generator and API used are much simpler, and do not allow this at the time. Also, instead of condensing the separate classes you could generate one file, then feel free to `cat` it with any other declarations, if that's an option of course. \r\n\r\nUnfortunately at this time we are faced with a few technical limitations that I have no idea how to tackle, there will always be a trade-off, and there is no universal solution to all the problems concerning Java typings in JavaScript.\r\n\r\nWe do however appreciate suggestions, so if you've got one that can eliminate the module-hijacking one mentioned earlier, comply with TypeScript and Java standards, and be iterative, I'd love to hear it. \r\n\r\ntl;dr - The generator is meant to help you develop, but is in no way a huge universal tool that can translate all of Java. It is a work in progress, and it should get better with all of the community's help that we can get.","issue_id":1662082218436,"origin_id":272014027,"user_origin_id":10464986,"create_time":1484173195,"update_time":1484173760,"id":1667426589290,"updated_at":"2022-11-02T22:03:09.289000Z","created_at":"2022-11-02T22:03:09.289000Z"},{"_id":"6362e91dd297b621323b7ca3","body":"@Pip3r4o I must say you've done an **amazing job** with this so far! Please don't think I'm bashing any of your work. This is an absolutely critical tool for my development and I'm just letting you know what I've come across while using it. Thank you for this tool!\r\n\r\nI have debated not using `-generate-multiple` but I really like the description helpers that `android.17.d.ts` offer. I might end up migrating to one condensed declaration file using `android-24.jar` and including my libraries with it.\r\n\r\nI would love to help with this project. What kind of community support are you looking for?","issue_id":1662082218436,"origin_id":272028773,"user_origin_id":1457327,"create_time":1484177237,"update_time":1484177237,"id":1667426589303,"updated_at":"2022-11-02T22:03:09.302000Z","created_at":"2022-11-02T22:03:09.302000Z"}] comment

Recently updated to the latest generator and I'm noticing that many times `java.*` classes do not include periods. I notice you create a reference outside the `module` declarations but most...

question

Classes don't expose static fields from interfaces

[{"_id":"6362dd608041c95dfb1c9e66","body":"@snekbaev just want to throw some light on the matter - the issue is a bit tough to tackle, as inheritance chain can easily become very complicated in Java, and thus Interfaces extend Interfaces, and classes then implement those interfaces, but down the line other classes overwrite the static fields of said interfaces, etc. \r\nClasses in Java can have a property and a method with the same name, TypeScript classes can't. So there isn't a generic 1-shot solution.\r\nI'll let you know if and when we've got update on this.\r\n\r\nAs for the 'P.S', keeping the parameter names is not possible with the current implementation (and the external API that we use), so it is not in the works currently.","issue_id":1662082218441,"origin_id":265812525,"user_origin_id":10464986,"create_time":1481220900,"update_time":1481221542,"id":1667423584004,"updated_at":"2022-11-02T21:13:04.004000Z","created_at":"2022-11-02T21:13:04.004000Z"},{"_id":"6362dd608041c95dfb1c9e67","body":"@Pip3r4o yeah, that's what I thought.\r\n\r\nHad to use Android Studio to figure out what is where. But I guess that anyone who needs some native functionality will have to implement it in Android Studio\/XCode first and then port, otherwise it is quite time consuming and a painful journey.\r\n\r\nFeel free to close the issue if needed. Thank you!","issue_id":1662082218441,"origin_id":265821705,"user_origin_id":6025502,"create_time":1481223085,"update_time":1481223085,"id":1667423584009,"updated_at":"2022-11-02T21:13:04.008000Z","created_at":"2022-11-02T21:13:04.008000Z"},{"_id":"6362dd608041c95dfb1c9e68","body":"@snekbaev I hope that you do know that the android documentation is a click away at https:\/\/developer.android.com\/reference\/packages.html . There are even certain chrome extensions that make browsing it even easier. The generator is in experimental stage, and inconsistencies are to be expected. It is not currently being actively worked on.\r\n\r\nI personally consider developing with native functionalities to be easier now more than ever in JavaScript, with no need to open Android Studio, but there is still some way to go until it becomes streamlined. At the end of the day, it's about personal preferences.","issue_id":1662082218441,"origin_id":265825828,"user_origin_id":10464986,"create_time":1481224021,"update_time":1481224021,"id":1667423584011,"updated_at":"2022-11-02T21:13:04.011000Z","created_at":"2022-11-02T21:13:04.011000Z"},{"_id":"6362dd608041c95dfb1c9e69","body":"@Pip3r4o I think you missed my point, I'm not saying it is about the **generator** per se, but the **whole** process of working with native stuff in a scope of VSCode, TS and NS. For the sake of this comment, let's scope it to productivity.\r\n\r\nLet me elaborate: I'm a .NET Developer with AngularJS 1 experience. At the moment evaluating available technologies for mobile development. As for test project I decided to create an app that has two screens which can read, send, receive sms and update the UI accordingly. Started out with the then-current 2.3 NS in VSCode + NS plugin. Decided to go with Angular 2 + TS template. Both were new to me. Crafted the UI for the first screen, that experience was great. Next step - send the sms. First attempt was to find an existing plugin for that, the one discovered was actually opening the sms app whereas I wanted to send the sms directly, thus had to implement the solution myself. That led me to my first NS plugin creation attempt which was recreated the very next day using NS plugin seed project as the base. All that is fine so far. Now I had the structure and needed to implement the Android specific logic and this is when I ran into the joys of working with ```any``` variables like ```android```. Because I was using TS I wanted to leverage the strongly typed objects which also help with intellisense. But I didn't have typings. Implementation became slow and frustrating: I was jumping around numerous NS plugins, samples and platform declaration files, saw people having exactly similar experiences. Eventually I got tired and did myself a favor: fired up Android Studio and recreated the current state of the application in there. You wonder whether I know where the documentation is, the answer is yes. Am I going to use notepad to work with it taking into account that there are much better free \"intellisensed\" alternatives, then answer is no. \r\n\r\nLong story short, I implemented, debugged and tested the rest of the native functionality in Android Studio, learned about certain internals simply by navigating to corresponding methods (which are heavily commented) directly from the IDE. Then after some trial and error ported that code to my NS app. Keep in mind - all that was a first time experience for me. Also ran into situation when android17.ts wasn't helpful, because the required API was in 19. Then 2.4 came along, I used the generator and got rid of the most ```any```s.\r\n\r\nThat NS app is almost complete, I put it aside after running into several other issues (most reported). Now have successfully recreated and completed the very same app using Xamarin Android. Next will need to check out the RN.\r\n\r\nAll in all, right at this moment as the person who is new to all these I will say it is much easier and much more productive to write\/debug\/test native code snippets using own IDEs and then port to NS. The mentioned future\/potential streamlining does have some serious competition, thus expectations.\r\n\r\nWill see in a year or two :)\r\n\r\nP.S.: as a side note, the further I proceed with the evaluation of available mobile development frameworks the more it feels like platform differences should actually be embraced rather than brought to the common denominator :)","issue_id":1662082218441,"origin_id":265874324,"user_origin_id":6025502,"create_time":1481235915,"update_time":1481235915,"id":1667423584013,"updated_at":"2022-11-02T21:13:04.013000Z","created_at":"2022-11-02T21:13:04.013000Z"}] comment

Hi, I'm using the aforementioned experimental build option and it is quite handy. What I noticed though is that if there is an inheritance then it is not possible to...

bug

Input aar file type support

[{"_id":"6362dd8dd297b621323b7824","body":"@roblav96 for the time being you can extract the `classes.jar` from the `.aar` and pass it as a parameter to the generator. Feel free to rename the `.jar` to whatever you feel like to avoid naming conflicts. \n","issue_id":1662082218448,"origin_id":250754411,"user_origin_id":10464986,"create_time":1475244705,"update_time":1475244705,"id":1667423629122,"updated_at":"2022-11-02T21:13:49.121000Z","created_at":"2022-11-02T21:13:49.121000Z"},{"_id":"6362dd8dd297b621323b7825","body":"@roblav96 A little unrelated to the issue, but thought it's worth sharing - I tried inputting as many jars and aars into the generator and it kind of... worked. Due to limitations in TypeScript and JavaScript modules (namespaces) that contain `.android.` anywhere in the namespace will confuse the TypeScript compiler, and invalidate all previously declared classes in `android.` (Android SDK) resulting in TSC errors. \nGoogle's play-services libraries reside in the `com.google.android.gms` note the `.android.` and that is a showstopper for now.\n\nFor these reasons we are rolling out dts generation support behind a `tns build\/run android --androidTypings` flag , in 2.4.0, with support for **only** the _android SDK_ and all _android support libraries_\n","issue_id":1662082218448,"origin_id":258843036,"user_origin_id":10464986,"create_time":1478527412,"update_time":1478527412,"id":1667423629125,"updated_at":"2022-11-02T21:13:49.124000Z","created_at":"2022-11-02T21:13:49.124000Z"},{"_id":"6362dd8dd297b621323b7826","body":"@Pip3r4o Interesting. That might explain why I could never get full https:\/\/github.com\/OneSignal\/OneSignal-Android-SDK declarations since it required `com.google.android.gms`.\n\nWhat's strange is that when I throw `com.soundcloud.android.crop` https:\/\/github.com\/jdamcd\/android-crop through the generator the declarations come out fine.\n\n``` typescript\ndeclare module com {\n export module soundcloud {\n export module android {\n export module crop {\n export class Crop extends java.lang.Object {\n public static REQUEST_CROP: number;\n public static REQUEST_PICK: number;\n public static RESULT_ERROR: number;\n public start(param0: android.content.Context, param1: android.support.v4.app.Fragment, param2: number): void;\n public static pickImage(param0: android.app.Activity): void;\n public start(param0: android.content.Context, param1: android.support.v4.app.Fragment): void;\n public asSquare(): com.soundcloud.android.crop.Crop;\n public static of(param0: android.net.Uri, param1: android.net.Uri): com.soundcloud.android.crop.Crop;\n ...\n }\n }\n }\n }\n}\n```\n","issue_id":1662082218448,"origin_id":258853426,"user_origin_id":1457327,"create_time":1478529796,"update_time":1478529796,"id":1667423629127,"updated_at":"2022-11-02T21:13:49.127000Z","created_at":"2022-11-02T21:13:49.127000Z"},{"_id":"6362dd8dd297b621323b7827","body":"@roblav96 declarations do come out fine-looking, executing `tsc` however will throw errors saying `content not found on com.soundcloud.android` when the typing should instead be referring to `android.content.Context`\n","issue_id":1662082218448,"origin_id":258863084,"user_origin_id":10464986,"create_time":1478531844,"update_time":1478533445,"id":1667423629131,"updated_at":"2022-11-02T21:13:49.131000Z","created_at":"2022-11-02T21:13:49.131000Z"},{"_id":"6362dd8dd297b621323b7828","body":"@Pip3r4o Yes that's certainly true.\n","issue_id":1662082218448,"origin_id":259335882,"user_origin_id":1457327,"create_time":1478668742,"update_time":1478668742,"id":1667423629134,"updated_at":"2022-11-02T21:13:49.133000Z","created_at":"2022-11-02T21:13:49.133000Z"}] comment

How would I go about using an `aar` file instead of `jar`? I'd like to input `play-services-maps-9.4.0.aar` into the dts-generator.

enhancement

Importing dependencies for a .jar file

[{"_id":"6362da634267bf3cd4498456","body":"It seems like I need to modify the `Java Build Path` as described [here](https:\/\/developer.amazon.com\/public\/apis\/engage\/device-messaging\/tech-docs\/03-setting-up-adm).\n\nIs there a way I can always set `-input android-support-v13.jar` and `-input android.jar` for every `jar`?\n","issue_id":1662082218450,"origin_id":242987996,"user_origin_id":1457327,"create_time":1472405905,"update_time":1472406049,"id":1667422819310,"updated_at":"2022-11-02T21:00:19.310000Z","created_at":"2022-11-02T21:00:19.310000Z"}] comment

# 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...

Kotlin can generate namespaces with `function`. We end up with `export module function` which is forbidden. Not sure if we can fix this and still keep the typings for that...

example `implementation 'com.drivequant.drivekit:drivekit-trip-analysis:1.27.2'`

The [AppCues SDK](https://github.com/appcues/appcues-android-sdk) demonstrates a great case of conditions to consider to improve the typing generation. If types are generated the following issues will be seen: - generics that aren't...

Fix issue run command `gradlew jar` by removing whitespace in ns_default_bcel_version