Reputation: 35
I've got a serious problem with my .res file (base.res). I'm using the latest plug in and had my client libs set to latest. I am Using Eclipse Oxygen.
I decided to switch the libs back from Latest to 3.7 to try to pinpoint a layout issue I was having.
At which point the resource file (base.res) throws an error and when I debug the code in Resource.class, I find that when it loads the theme, one of the keys is an empty string (on about iteration 9) and it falls into the following line as it doesn't meet any of the other criteria. Worryingly switching the client libs back to latest also throws an error.
// thow an exception no idea what this is
throw new IOException("Error while trying to read theme property: " + key);
When this has occurred previously I went back to previous version in svn and reapplied my changes - cumbersome but it worked - I put it down to a one off aberration.
Now when I pull the version from the 29Dec from subversion I get a Unexpected EOF error when the .res file is loaded. The svn version was all correct at time of commit, as it was tested and signed off by our QA. Previous set of libs and plugin possibly.
The files (both) open correctly in the designer and I have tried copying the theme and re-saving the res files. All to no avail.
As far as XML team mode is concerned, I can never find the XML files in eclipse, so I installed netbeans and opened the res file in that and re-saved with XML team mode enabled, - whilst I can see references to the images, the file base.xml is empty - I guess, some corruption is making creating the XML file fail.
UPDATE
I have reverted all the source back to the last check in. The libs were set to 3.3 and all compiled and ran on my machine. Submitted a build to the server which failed (not unreasonably) saying that the oldest pro version supported is 3.7.
I updated the lib settings to 3.7 and resubmitted the build. I now get a crash when the build step executes the app - this out of the logs at https://s3.amazonaws.com/codenameone-build-response/
[EDT] 0:0:0,86 - CREATING DISPLAY MANANAGER - likely start of an app run
[EDT] 0:0:0,91 - Exception: java.lang.NullPointerException - null
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:459)
at com.codename1.ui.util.Resources.loadTheme(Resources.java:1322)
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.open(Resources.java:677)
<truncated>
[EDT] 0:0:0,118 - Failed to load base resource file.
[EDT] 0:0:0,118 - Exception: java.io.IOException - null
I've missed something somewhere on the path from 3.3 to 3.7, just not sure what.
Upvotes: 2
Views: 251
Reputation: 52770
This happens when you use an old client library with a new skin file. New skin files use newer native themes within so when the old client library tries to load the theme file from the skin it fails.
There are two solutions:
Use latest cn1lib although 3.8 should be new enough. 3.7 is really old by now (make sure you use Codename One Settings and not the old preferences UI).
Use an old skin file and add it manually instead of through the skin manager. Since most people are already on 3.8 there wasn't much demand for it so we didn't prepare anything convenient. You can probably find an old skin by looking through the history in https://github.com/codenameone/codenameone-skins/
Upvotes: 1