问题
When I try to load just a simpel Codename1 Hello World tutorial app I get this error:
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)
at dk.cp3.appname.MyApplication.init(MyApplication.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.codename1.impl.javase.Executor$1$1.run(Executor.java:117)
at com.codename1.ui.Display.processSerialCalls(Display.java:1152)
at com.codename1.ui.Display.mainEDTLoop(Display.java:969)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
I have looked at the net and found some people having the same error but relate it to NetBeans. I use Eclipse 4.7.
回答1:
Right click the project, select Codename One -> Codename One Settings -> Basic -> Update Client Libs.
This should update the locally installed libraries to the latest which should work correctly with the current theme. Make sure your plugin is up to date too although this shouldn't impact that exception.
来源:https://stackoverflow.com/questions/46909312/codenameone-error-while-trying-to-read-theme-property