Salihcan
Salihcan

Reputation: 111

LibGDX doesn't export to android

The codes are the same as the default of libgdx

public class MyGdxGame extends ApplicationAdapter {
SpriteBatch batch;

@Override
public void create () {
    batch = new SpriteBatch();
}

@Override
public void render () {
    Gdx.gl.glClearColor(1, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    batch.begin();
    batch.end();
}

@Override
public void dispose () {
    batch.dispose();
}
}

Where is the problem ? When I open this game on my smartphone, I take this message "Unfortunately My-Gdx-Game has stopped"

What should I do if the problem is in SDKs

Upvotes: 0

Views: 58

Answers (1)

The Problem Solver
The Problem Solver

Reputation: 23

Technically I cannot comment so I am answering here,

1) try again after commenting out these two lines from your render function:-

batch.begin();  
batch.end();  

2) also type this command in android studio command prompt(assuming you are using android studio for this) and tell me what happens :

gradlew desktop:run

Upvotes: 1

Related Questions