Search code examples
nativecodenameonelib

create a new cn1lib with the netbeans codenameone plugin?


I am trying to create a codenameone cn1 lib but each time I try to generate the native stubs by clicking on the "Generate Native Access" menu (like stated in the developers documentation), from my NativeInterface extended interface file, I have this error message:

A method with the same name exits for the method emit, notice that duplicate names (even with different cases) aren't supported

and the native stubs aren't generated (the native folder contains empty OS folders). I tried to change the name of my class (in which case I don't have the message the first time I re-run "Generate Native Access" with a complete new name, but the stubs aren't generated either...), to delete my project and recreate it or create a new one, to restart my computer even! but I always have this message each time I try to "Generate Native Access" with a class name already tried in the past (even if it was in another project that could have been deleted since...). And in any case, the stubs files aren't created...

How can I fix this issue? (codenameone seems to keep a shared (between projects) history of all created nativeInterface, that is never cleaned. But where?)

I am using the NetBeans codenameone plugin on Windows 10 x64


Solution

  • You have 2 methods named emit possibly with different case or different arguments. That works great for Java but might not work great for other languages. The error message simply stated you need to rename one of the emit methods and give it a different name.