Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:25:29+00:00 2026-06-17T17:25:29+00:00

I am using tiled to create map for my game.I am using AndEngine framework

  • 0

I am using tiled to create map for my game.I am using AndEngine framework for developing games in android.In OnLoadResource method i am loading tmx file using load map method.When game builds,it throws “unfortunately stopped working” at this line.At first it shows, it cannot find images and i cleared that error.Now at this line game stops.Please help me because i am new to tile based games.

this.mTMXTiledMap = mTMXLoader.loadFromAsset(this,"tmx/levelmap.tmx"); 

Here is the code snippet:

private void loadMap() 
{
this.mRepeatingSpriteBackground = new   RepeatingSpriteBackground(CAMERA_WIDTH,CAMERA_HEIGHT, this.mEngine.getTextureManager(),new   AssetBitmapTextureAtlasSource(this, mapBG), 1.0f);

try 
{
final TMXLoader mTMXLoader = new TMXLoader(this, this.mEngine.getTextureManager(),  TextureOptions.BILINEAR_PREMULTIPLYALPHA, null);

this.mTMXTiledMap = mTMXLoader.loadFromAsset(this,"tmx/levelmap.tmx");
} 
catch (final TMXLoadException tmxle) 
{
Debug.e(tmxle);
}
}

And here is the Logcat:

01-18 19:37:52.759: E/AndroidRuntime(643): java.lang.ArithmeticException: divide by zero
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.anddev.andengine.entity.layer.tiled.tmx.TMXTileSet.getTextureRegionFromGlobalTileID(TMXTileSet.java:154)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.anddev.andengine.entity.layer.tiled.tmx.TMXTiledMap.getTextureRegionFromGlobalTileID(TMXTiledMap.java:193)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.anddev.andengine.entity.layer.tiled.tmx.TMXLayer.addTileByGlobalTileID(TMXLayer.java:289)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.anddev.andengine.entity.layer.tiled.tmx.TMXLayer.initializeTMXTilesFromDataString(TMXLayer.java:268)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.anddev.andengine.entity.layer.tiled.tmx.TMXParser.endElement(TMXParser.java:193)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.apache.harmony.xml.ExpatParser.endElement(ExpatParser.java:156)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.apache.harmony.xml.ExpatParser.appendBytes(Native Method)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:513)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:474)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:321)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:279)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.anddev.andengine.entity.layer.tiled.tmx.TMXLoader.load(TMXLoader.java:93)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.anddev.andengine.entity.layer.tiled.tmx.TMXLoader.loadFromAsset(TMXLoader.java:78)
01-18 19:37:52.759: E/AndroidRuntime(643):  at apk.games.robowars.RoboWars.loadMap(RoboWars.java:577)
01-18 19:37:52.759: E/AndroidRuntime(643):  at apk.games.robowars.RoboWars.onLoadResources(RoboWars.java:248)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.anddev.andengine.ui.activity.BaseGameActivity.doResume(BaseGameActivity.java:168)
01-18 19:37:52.759: E/AndroidRuntime(643):  at org.anddev.andengine.ui.activity.BaseGameActivity.onWindowFocusChanged(BaseGameActivity.java:85)
01-18 19:37:52.759: E/AndroidRuntime(643):  at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2423)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:25:30+00:00Added an answer on June 17, 2026 at 5:25 pm

    It looks like you have a problem with the file paths inside the TMX file. See this and this thread on the AndEngine forum for more detail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an isometric .TMX file created with Tiled, I'm using AndEngine GLES1. I
I'm using tiled to create a tile map. (Tiled is a tile map editor
I'm using C++ to create a tile map for a game. My problem is,
I am new to android and developing a small game based on AndEngine (www.andengine.org).
using a file I want to create a map and I am wondering about
So i am using tiled to create levels for my new iphone game. The
I'm currently developing my first android app, and my first game. I've been developing
I am writing a map editing program for a 2D game using XNA. To
Im currently creating a tile-based game for android. Using java via dalvik JVM. im
I am using AndEngine to create a Test run project. I am doing well

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.