I tried and tried to run this code in a new "bare bones" project, but there is nothing to do, it always gives me the following error:
/home/francesco/NetBeansProjects/TestUUID/src/net/informaticalibera/test/UUID/MyApplication.java:62: error: cannot find symbol
hi.add(new SpanLabel(Util.getUIID()));
symbol: method getUIID()
location: class Util
1 error
Code that is known to work, it's an example that I inserted in the Javadoc of Util.getUIID:
Form hi = new Form("Test UIID", BoxLayout.y());
Button button = new Button("Generate 10 UIID");
hi.add(button);
hi.show();
button.addActionListener(l -> {
String myId = "myUsername"; // do not exceed 12 characters
Preferences.set("CustomDeviceId__$", Long.parseLong(myId, 36));
hi.add(new SpanLabel("10 Random UUID"));
for (int i = 0; i < 10; i++) {
hi.add(new SpanLabel(Util.getUIID()));
}
hi.revalidate();
});
I think it is a problem of updating the Codename One libraries, which maybe in a project bare bones are old. However, opening "Codename One Settings", clicking on the hamburger menu at the top right and choosing first "Update" and then "Save" I keep getting the same error. If I try to use the old version of the "Codename One Settings" GUI, clicking on "Basic" and then "Update Project Libs", the problem remains. I don't know what to do.
Is it a Codename One bug or am I not doing the right action?