ahew
ahew

Reputation: 116

Libgdx Android Gradle Build Errors

My desktop application works, but my android application does not. there are a few errors in the launcher file, and I assume they have something to do with the package and or connected libraries. I have tried many things, but cannot get to the bottom of it. Here is the AndroidLauncher code with errors on commented lines. Thanks much.

package com.ahewdev.spacepace.android;
import android.os.Bundle; //----------ERROR
import com.badlogic.gdx.backends.android.AndroidApplication; //-------ERROR
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //-ERROR
import com.ahewdev.spacepace.spacepace; //---------ERROR
public class AndroidLauncher extends AndroidApplication {
    @Override //---------ERROR
    protected void onCreate (Bundle savedInstanceState) {
        super.onCreate(savedInstanceState); //---------ERROR
        AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
        initialize(new spacepace(), config);
    }
}

Upvotes: 0

Views: 654

Answers (1)

Willem
Willem

Reputation: 317

You probably haven't asked for the right permissions in AndroidManifest.xml.

If you use things like networking or the user's location you have to declare you want to use them in AndroidManifest.xml, or the application will crash at startup.

Here's the default list of permission groups you can use: Android Developer Documentation

And here's the LibGDX article on permissions: LibGDX wiki

I hope this solves your problem!

Upvotes: 1

Related Questions