question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

crash when loading an animated map

See original GitHub issue

Issue details

GDX attempts to cast from AnimatedTiledMapTile to StaticTiledMapTile which causes an exception.

Reproduction steps/code

Load a map with animated tiles.

Version of LibGDX and/or relevant dependencies

1.9.10

Stacktrace

Exception in thread "main" java.lang.ClassCastException: com.badlogic.gdx.maps.tiled.tiles.AnimatedTiledMapTile cannot be cast to com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile
	at com.badlogic.gdx.maps.tiled.BaseTmxMapLoader.addAnimatedTile(BaseTmxMapLoader.java:656)
	at com.badlogic.gdx.maps.tiled.BaseTmxMapLoader.loadTileSet(BaseTmxMapLoader.java:614)
	at com.badlogic.gdx.maps.tiled.BaseTmxMapLoader.loadTiledMap(BaseTmxMapLoader.java:156)
	at com.badlogic.gdx.maps.tiled.TmxMapLoader.load(TmxMapLoader.java:81)

Please select the affected platforms

  • Android
  • iOS (robovm)
  • iOS (MOE)
  • HTML/GWT
  • Windows
  • Linux
  • MacOS

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mgsx-devcommented, Jan 12, 2020

@kennycason it’s only on master branch for now, you can use libgdx “1.9.11-SNAPSHOT” to have the fix.

1reaction
electronstudiocommented, Aug 3, 2019

To reproduce the issue you just need your game to load an animated map. Sorry I can’t post the source of my game. But you can check the source code of LibGDX, it’s doing an illegal type cast from AnimatedTiledMapTile to StaticTiledMapTile. It worked fine in 1.9.9 with the same map so it’s something that was introduced in 1.9.10.

BaseTmxMapLoader.java:656:
    staticTiles.add((StaticTiledMapTile)tileSet.getTile(firstgid + frameElement.getIntAttribute("tileid")));
Read more comments on GitHub >

github_iconTop Results From Across the Web

SFM crashes when loading maps - Reddit
Hi. SFM starts normally, and I can create sessions and move the timeline around, but whenever I load a map, it crashes instantly....
Read more >
Unreal Engine crash on loading specific map
The project opens up fine when resetting the main-map to load (so it doesn't crash entirely on startup), and I can run and...
Read more >
Crashes When Loading Specific Campaign/Track Maps
When trying to play specific maps, my game will crash every time, but only on very specific maps.
Read more >
Crash when starting animation from background thread #1556
This code can be used in an app without mapbox to create animations. It's the mapbox WorkerThreadException that is preventing downstream from ...
Read more >
App Crash on loading Google Maps view [221643638]
We suspect it's likely due to some issue when initializing map surfaces that aren't immediately visible too, as we have a map that's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found