MathewWi / cmpt371t1

Automatically exported from code.google.com/p/cmpt371t1
0 stars 0 forks source link

XmlLevelBuilder crashes on build #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This issue has me 100% stuck on level editor.

To make the level editor I just copy and paste the entire XmlLevel package from 
luminance into the editor project.  Nothing changes.

On save I turn my data into an XmlLevel and pass it on to the builder.

When I call the function to start it up I get this exception:
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Stub!
    at android.util.Xml.newSerializer(Xml.java:16)
    at ca.sandstorm.luminance.level.XmlLevelBuilder.<init>(XmlLevelBuilder.java:27)
    at ca.sandstorm.luminance.leveleditor.LevelEditor$6.actionPerformed(LevelEditor.java:332)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

The line in question is:
    public XmlLevelBuilder()
    {
    _serializer = Xml.newSerializer();
    _writer = new StringWriter();
    }

    _serializer = Xml.newSerializer();

Causes the crash.

To fix it try testing your Xml stuff on PC, not the android.

Original issue reported on code.google.com by shinhals...@gmail.com on 29 Mar 2011 at 10:38

GoogleCodeExporter commented 9 years ago
Not being able to save is the only thing holding the level editor back.

I think I found the answer to this problem.  You cannot use any Android library 
stuff in your Xml code or I cannot use it in my stand alone app.  The exception 
above means the code is there but the implementation is not.  Your XML 
parsing/saving can therefore only be run on the Android and thus needs to be 
rewritten to use native java xml parsing/saving.

This has to be done asap.

Original comment by shinhals...@gmail.com on 29 Mar 2011 at 11:48

GoogleCodeExporter commented 9 years ago
Reverted file back to how it was originally and got it working separate from 
the android project.  Since it's a stand alone program anyway it doesn't really 
need to be able to compile in the android project.  Once this restriction was 
gone it was fairly easy to get it working properly.

Original comment by steven.i...@gmail.com on 30 Mar 2011 at 3:30