尝试读取主题属性时发生CodenameOne错误

尝试读取主题属性时发生CodenameOne错误

问题描述:

当我尝试仅加载一个Simpel Codename1 Hello World教程应用程序时,出现此错误:

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) 

我看了看网,发现有些人有相同的错误,但是关系它到NetBeans。我使用Eclipse 4.7。

I have looked at the net and found some people having the same error but relate it to NetBeans. I use Eclipse 4.7.

右键单击项目,选择代号一->代号一设置->基本->更新客户端库。

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.