2

I have created a project using libgdx project generator, then I imported him to Eclipse. Then run on android emulator, but there is an error "libgdx requires OpenGL ES 2.0". I dont know what is the problem

public class AndroidLauncher extends AndroidApplication {
    @Override
    protected void onCreate (Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
        initialize(new MyGdxGame(), config);
    }


}

public class MyGdxGame extends ApplicationAdapter {

    SpriteBatch batch;
    Texture img;

    @Override
    public void create () {
        batch = new SpriteBatch();
        img = new Texture("badlogic.jpg");
    }

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


}

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mygdx.game.android"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" />

    <uses-feature android:glEsVersion="0x00020000" android:required="true" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/GdxTheme" >
        <activity
            android:name="com.mygdx.game.android.AndroidLauncher"
            android:label="@string/app_name" 
            android:screenOrientation="landscape"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
lazexe
  • 367
  • 4
  • 19
  • possible duplicate of [LibGDX HelloWorld project crashes when run on Android emulator](http://stackoverflow.com/questions/22703940/libgdx-helloworld-project-crashes-when-run-on-android-emulator) – P.T. May 02 '14 at 04:28

1 Answers1

1

LibGDX does not support anything < OpenGL ES 2.0 anymore, since version 1.0.

That's not a problem in most cases, because nowadays there are less than 0.1% of all devices which do not support OpenGL ES 2.0. See the statistics here.

In your case it is probably the fault of the emulator. You should not use that to test your games, since it is terribly slow and takes extremely long to start. Use a real device and run your app there, which will save you a lot of time and you will get more realistic results.

With LibGDX, you can even skip this step, since it is a cross platform framework, meaning that you can just run your game on your desktop PC for debugging and testing and only in the end test it on mobile devices.

If you really need OpenGL ES 1.1 support, you can use LibGDX version 0.9.9, which still supported it.

noone
  • 19,520
  • 5
  • 61
  • 76