SimpleDialogFragments icon indicating copy to clipboard operation
SimpleDialogFragments copied to clipboard

BuildNotImplemented lint check: false error when dialog is used from Kotlin

Open mtotschnig opened this issue 7 years ago • 6 comments

The BuildNotImplemented lint check raises an error for a call to any of the dialogs' build method from a Kotlin class: Bildschirmfoto 2019-09-07 um 13 48 46

mtotschnig avatar Sep 07 '19 11:09 mtotschnig

That's the intended behaviour when calling build on a subclass that does not implement/overwrite the method. See #31 and issues referenced there.

(In case I misunderstood that's because you didn't provide the information requested in the issue template)

eltos avatar Sep 09 '19 06:09 eltos

Sorry for the incomplete information. The error is raised on calls on classes that implement the build method, for example: SimpleListDialog.build() or SimpleInputDialog.build()

mtotschnig avatar Sep 09 '19 06:09 mtotschnig

Okay then it's not intended 😄
I'm afraid I have not used Kotlin so I don't think I can fix this on my own.
Nevertheless, what exactly did you call that raised the error (complete minimal not-working example)? Was it SimpleInputDialog.build();? Maybe there are some special precautions to be done when performing lint checks for Kotlin?

eltos avatar Sep 30 '19 10:09 eltos

This can be solved by using only build() and importing whatever you're going to use. That means if you're using 'SimpleColorDialog.build()' then just use 'build()' and import 'SimpleColorDialog'.

This will work in Kotlin. What will not work is that your project won't compile because of duplicate AndroidManifest.xml which I'm facing right now and also the reason why I'm here.

sharmanitin0497 avatar Apr 03 '20 06:04 sharmanitin0497

Thank you @sharmanitin0497 for the hint. The manifest problem sounds like an independent issue, would you mind opening a dedicated issue and give some more details about it?

eltos avatar Apr 04 '20 15:04 eltos

And for multiple Dialogs, you can use aliases as

import eltos.simpledialogfragment.color.SimpleColorDialog.build as SimpleColorDialog
import eltos.simpledialogfragment.form.SimpleFormDialog.build as SimpleFormDialog

Then, call them just like SimpleColorDialog(). or SimpleFormDialog().. This way you don't have to use build().

But, the reason I came here is I can't build the project because it shows Cause: duplicate entry: AndroidManifest.xml in Kotlin even when the jar file doesn't contain a manifest file. It will work if I remove this library. Why?

Fauzdar1 avatar Jun 23 '20 20:06 Fauzdar1