Skip to content Skip to sidebar Skip to footer

Libgdx 'myfirsttriangle' Example Crashes On Startup

Upon finishing this tutorial for the libGDX android library, the desktop project runs fine and there are no errors anywhere that eclipse points out. When I go to run it on my Nexus

Solution 1:

Building Android apps out of multiple projects is far more fiddly than it should be. Basically, when the ADT built your Android package it forgot to include your Libgdx "core" package (my-first-triangle) in the build.

Right-click on your Android Project in the Package Explorer, click Properties, select the Java Build Path. The problem is most likely on the Order and Export tab. Make sure your my-first-triangle project is marked for export (it should have a checkmark set).

This isn't a Libgdx issue. Its just that Libgdx breaks applications into multiple packages so gets tripped up by this more often than regular Android users.

Solution 2:

Check to make sure your Build Path is correct. In the latest version of Android you need to explicitly export your Private Libraries.

EDIT: More likely than not you need to go to your properties => Java Build Path => Order and Export (tab) then check the box for Android Private Libraries to make sure that all the libGDX classes are linked with your project.

Post a Comment for "Libgdx 'myfirsttriangle' Example Crashes On Startup"