title: TMX Tiled Andengine Android - FATAL EXCEPTION -
body: <p>Just getting started with using tmx tiled maps files as maps for my 2d platformer. This is the code I have so far.</p>
  
  <pre><code>    private void loadLevel() {
      // TODO Auto-generated method stub
      try {
          TMXLoader tmxLoader = new TMXLoader(
                  ResourceManager.getInstance().activity.getAssets(),
                  engine.getTextureManager(),
                  TextureOptions.BILINEAR_PREMULTIPLYALPHA, vbom);
  
          this.mTMXTiledMap = tmxLoader.loadFromAsset("tmx/testmap2.tmx");
      } catch (final TMXLoadException tmxle) {
          Debug.e(tmxle);
      }
      for (int i = 0; i &lt; this.mTMXTiledMap.getTMXLayers().size(); i++) {
          TMXLayer layer = this.mTMXTiledMap.getTMXLayers().get(i);
          this.attachChild(layer);
      }
      for (final TMXObjectGroup group : this.mTMXTiledMap
              .getTMXObjectGroups()) {
          for (final TMXObject object : group.getTMXObjects()) {
  
              if (group.getName().equals("Unwalkable")) {
                  Rectangle rect = new Rectangle(object.getX(),
                          object.getY(), object.getWidth(),
                          object.getHeight(), vbom);
  
                  FixtureDef boxFixtureDef = PhysicsFactory.createFixtureDef(
                          0.0f, 0.0f, 1f, false,
                          CATEGORYBIT_WALL,
                          MASKBITS_WALL, (short) 0);
  
                  PhysicsFactory.createBoxBody(physicsWorld, rect,
                          BodyType.StaticBody, boxFixtureDef);
  
                  rect.setVisible(false);
  
                  final PhysicsHandler physicsHandler = new PhysicsHandler(
                          rect);
                  rect.registerUpdateHandler(physicsHandler);
  
                  attachChild(rect);
  
              }
  
          }
      }
  }
  </code></pre>
  
  <p>But it's giving me this error - FATAL EXCEPTION: UpdateThread and java.lang.IllegalArgumenetException: No value found for attribute: 'width'</p>
  
  <p>Is this a problem with my tmx file? How it's encoded or how I set it up? Or is it on the coding end?? Thanks guys I really appreciate the help. Here's the rest of the LogCat in case you have a use for it.</p>
  
  <pre><code>04-25 08:36:01.716: E/AndroidRuntime(13119): FATAL EXCEPTION: UpdateThread
  04-25 08:36:01.716: E/AndroidRuntime(13119): java.lang.IllegalArgumentException: No value found for attribute: 'width'
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.util.SAXUtils.getAttributeOrThrow(SAXUtils.java:47)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.util.SAXUtils.getIntAttributeOrThrow(SAXUtils.java:86)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.extension.tmx.TMXObjectGroup.&lt;init&gt;(TMXObjectGroup.java:37)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.extension.tmx.TMXParser.startElement(TMXParser.java:161)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.apache.harmony.xml.ExpatParser.startElement(ExpatParser.java:143)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.apache.harmony.xml.ExpatParser.appendBytes(Native Method)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:513)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:474)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:321)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:279)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.extension.tmx.TMXLoader.load(TMXLoader.java:117)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.extension.tmx.TMXLoader.loadFromAsset(TMXLoader.java:102)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at com.meowcatfighter.goodygreen.scene.GameScene.loadLevel(GameScene.java:96)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at com.meowcatfighter.goodygreen.scene.GameScene.createScene(GameScene.java:85)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at com.meowcatfighter.goodygreen.scene.SceneManager.setGameScene(SceneManager.java:75)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at com.meowcatfighter.goodygreen.scene.MainMenuScene.onMenuItemClicked(MainMenuScene.java:66)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.entity.scene.menu.MenuScene.onAreaTouched(MenuScene.java:139)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.entity.scene.Scene.onAreaTouchEvent(Scene.java:413)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.entity.scene.Scene.onSceneTouchEvent(Scene.java:357)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.entity.scene.CameraScene.onSceneTouchEvent(CameraScene.java:64)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.entity.scene.Scene.onChildSceneTouchEvent(Scene.java:420)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.entity.scene.Scene.onSceneTouchEvent(Scene.java:338)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.engine.Engine.onTouchScene(Engine.java:452)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.engine.Engine.onTouchEvent(Engine.java:438)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.input.touch.controller.BaseTouchController$TouchEventRunnablePoolItem.run(BaseTouchController.java:102)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.util.adt.pool.RunnablePoolUpdateHandler.onHandlePoolItem(RunnablePoolUpdateHandler.java:54)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.util.adt.pool.RunnablePoolUpdateHandler.onHandlePoolItem(RunnablePoolUpdateHandler.java:1)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.util.adt.pool.PoolUpdateHandler.onUpdate(PoolUpdateHandler.java:88)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.input.touch.controller.BaseTouchController.onUpdate(BaseTouchController.java:62)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.engine.Engine.onUpdate(Engine.java:584)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.engine.Engine.onTickUpdate(Engine.java:548)
  04-25 08:36:01.716: E/AndroidRuntime(13119):    at org.andengine.engine.Engine$UpdateThread.run(Engine.java:820)
  </code></pre>
  
  <p>(edit - Much thanks to Matej Spili for editing the LogCat! It's much easier on the eyes now! :D)</p>
  
  <p>EDIT 4/29/14</p>
  
  <p>So, so I spoke to bjorn, the maker of Tiled.</p>
  
  <ul>
  <li>Me - it just seems to not matter what code i use though because it's always that error</li>
  <li><p>Me - when i look one of the example tmx files, at the end it looks like....</p>
  
  <pre><code>&lt;objectgroup name="Unwalkable" width="400" height="21"&gt;
  </code></pre></li>
  <li>Me - but when i look out the tmx file i created, there is no height and width specification. how do you specify the height/width of an object layer?</li>
  <li>bjorn - dpod: Those attributes are no longer written out.</li>
  <li>bjorn - dpod: AndEngine should be fixed to not need them. They were basically always meaningless since object groups have no size restriction.</li>
  <li>bjorn - These function names like "getTMXObjectGroupProperties" or "containsTMXProperty" are absolutely crazy...</li>
  <li>bjorn - In Tiled, that code would be more like: "foreach (ObjectGroup *group, map->objectGroups()) { if (group->hasProperty("wall")) { ...</li>
  <li>IRC - [15:02] == bjorn [~quassel@pdpc/supporter/active/bjorn]</li>
  <li>IRC - [15:02] == realname : Thorbjørn Lindeijer</li>
  <li>IRC - [15:02] == channels : #tiled</li>
  <li>IRC - [15:02] == server : asimov.freenode.net [TX, USA]</li>
  <li>IRC - [15:02] == account : bjorn</li>
  <li>IRC - [15:02] == End of WHOIS</li>
  <li>Me - oh my gosh you're the guy who made tiled?!</li>
  </ul>
  
  <p>That was fun haha. But now I've got load of more questions! What on earth is foreach?</p>