Hi,
I wanted to begin a new codename one app, but encountered problems with some of the options I tried.
I'm using:
Windows 10
Eclipse 4.7.0
CodeNameoneFeature 3.7.3
Simulator
I tried creating a new barebones hello world project (using the flat blue theme). It compiles, but when I run in the simulator, it throws an exception, when the theme.res file is first loaded in the init().
java.io.IOException: Error while trying to read theme property:
at com.codename1.ui.util.Resources.loadTheme(Resources.java:1475)
at com.codename1.ui.util.Resources.openFileImpl(Resources.java:303)
at com.codename1.ui.util.Resources.openFile(Resources.java:269)
at com.codename1.ui.util.Resources.<init>(Resources.java:189)
at com.codename1.ui.util.Resources.open(Resources.java:740)
at com.codename1.ui.util.Resources.openLayered(Resources.java:702)
at com.codename1.ui.util.Resources.openLayered(Resources.java:666)
at com.codename1.ui.plaf.UIManager.initFirstTheme(UIManager.java:1564)
In the debugger, the key in the loadTheme() method is an empty string. (local variable iter had a value of 4 when the exception was thrown).
The simulator runs, but the theme isn't applied.
I have an older app that also uses the flat blue theme, and it still runs fine. I even tried replacing the "new" theme.res with the one from that older app, but the exception was the same, (in the new barebones hello world app).
As an experiment I tried generating a different project, "Get Started App" template with the business theme, i.e. the defaults.
It gave the same error as above.
Also, it failed to load the apple-icon.png from the resource (resulting in a null pointer exception, and termination). This was despite the fact that the image in question definitely is where it should be in the theme, as determined by running the theme editor!
The relevant code in the start() method:
Form hi = new Form("Welcome", new BorderLayout(BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE));
final Label apple = new Label(theme.getImage("apple-icon.png"));
Finally I tried running one of the Demo projects, the Clean Material demo. No errors. Runs fine.
Honestly I'm not sure whether I am skipping some important, initial step that I have forgotten (having been working on the same old app for a year).
Primarily I just wanted a "known good" app to send as my first iOS build. The clean material demo will do fine for this purpose.
But if there is some glitch in the way eclipse handles newly generated project templates (and not me making careless mistakes!) I thought it would be worth fixing for the sake of people coming to CN1 as new users.
Thanks,
Peter