1

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

1
  • Can you post the source of the native interface?
    – Shai Almog
    Mar 2, 2018 at 4:24

1 Answer 1

0

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.

2
  • oh yes. that was it. Thanks. I'm tired, didn't even realized I had an two emit functions (with different parametters) declared in my instance... Bytheway, still related to the creation of cn1ibs, there do not seem to be a "Codenameone Library" project type in the Eclipse plugin like in the Netbeans one. How are we supposed to create a codenameone library project in eclipse? (I usually prefer Eclipse over NetBeans) Mar 2, 2018 at 5:25
  • We don't have support for that at this time. It's one of those things we'd like to add but never got around to do because there is always something more important to do. Having said that a library project is just an Ant project and you can use one of the existing library projects in the cn1libs section as a starting point.
    – Shai Almog
    Mar 3, 2018 at 5:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.