# Fresh libgdx test project errors when running on Android

This topic is 1023 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I was experiencing this problem when attempting to run my game on an android emulator. Assuming that I had incorrectly changed the gradle.build file which was causing my error I created a fresh project to verify. Turns out I get this error anyways and therfore I have no idea how I would fix it.

:android:run
WARNING: linker: libdvm.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Starting: Intent { cmp=com.mygdx.game.android/.AndroidLauncher }
Error type 3
Error: Activity class {com.mygdx.game.android/com.mygdx.game.android.AndroidLauncher} does not exist.

BUILD SUCCESSFUL



I have changed nothing in gradles build file. Can someone point me in the right direction?

Sooooooo frustrating. I've looked and asked others for help already. Similar problems I've found say this error is caused by an application with the same id (not even surre how to change this but I'm pretty confident it's not related because I just created the emulator.) and  the emulator not having enough space. (It does). I've spent hours already troubleshooting this issue.

Edited by Clobslee

##### Share on other sites

Did I not add enough information? I'm still stuck. Effffffff.

##### Share on other sites
Out of curiosity, is that the name of your project? Did you name all your packages correctly, or modify them after they were first configured by your tools?

My guess from the error message (class does not exist) is that they don't match.

##### Share on other sites
You're trying to launch an Activity/Access a class that doesn't exist. Go ahead and check the classes/activity names in the AndroidManifest.xml ... If that still doesn't solve it show us the code of the manifest and a screenshot from the whole project.

Good luck.

##### Share on other sites

You're trying to launch an Activity/Access a class that doesn't exist. Go ahead and check the classes/activity names in the AndroidManifest.xml ... If that still doesn't solve it show us the code of the manifest and a screenshot from the whole project.

Good luck.

Thanks for the replies, gave up on the android build for now and just focusing on the back end for a day, completely forgot about this post.

I haven't tried it but this does indeed sound like the issue. Seems my tools are having trouble. Thanks!

EDIT: This ended up not being the issue!

Edited by Clobslee

##### Share on other sites

So this is weird but I guess that was not the problem... I'm very confused. When trying to run everything again this morning I started recieving the same error again. I haven't changed any of gradles.build files. The project builds for android succesfully but when I execute gradles "android:run" command I get the above error. My packages are correct as I have not altered them at all after using using the libgdx app to build the project. My emulator is running and recognized.

Here is the terminal

Configuration on demand is an incubating feature.
:android:run
WARNING: linker: libdvm.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Starting: Intent { cmp=com.mygdx.game.android/.AndroidLauncher }
Error type 3
Error: Activity class {com.mygdx.game.android/com.mygdx.game.android.AndroidLauncher} does not exist.

BUILD SUCCESSFUL

Total time: 2.155 secs



And the AndroidManifest

<?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="22" />

<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>


And my gradle.build file (I haven't changed anything)

buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
}
}

allprojects {
apply plugin: "eclipse"
apply plugin: "idea"

version = '1.0'
ext {
appName = 'my-gdx-game'
gdxVersion = '1.6.0'
roboVMVersion = '1.2.0'
box2DLightsVersion = '1.3'
ashleyVersion = '1.4.0'
aiVersion = '1.5.0'
}

repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}

project(":desktop") {
apply plugin: "java"

dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" } } project(":android") { apply plugin: "android" configurations { natives } dependencies { compile project(":core") compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi" natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi" natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86" } } project(":core") { apply plugin: "java" dependencies { compile "com.badlogicgames.gdx:gdx:$gdxVersion"
}
}

delete ".project"
}


[attachment=28773:helpME.png]

What is going on...?[attachment=28774:wtf.png]

Edited by Clobslee

##### Share on other sites

From your description what's going on is this:

Error: Activity class {com.mygdx.game.android/com.mygdx.game.android.AndroidLauncher} does not exist.

The files say to look for that class, and the launcher cannot find it.

Normally those names are changed into your own name or your website or whatever.

Are you using exactly that name for your Java pacakge? Is that what you see when you open your .java files, right at the top?  Is that the actual name of your class?  You should have an AndroidLauncher.java file, starting with the line "package com.mygdx.game.android;

My hunch is still that you changed the name.

##### Share on other sites

From your description what's going on is this:

Error: Activity class {com.mygdx.game.android/com.mygdx.game.android.AndroidLauncher} does not exist.

The files say to look for that class, and the launcher cannot find it.

Normally those names are changed into your own name or your website or whatever.

Are you using exactly that name for your Java pacakge? Is that what you see when you open your .java files, right at the top?  Is that the actual name of your class?  You should have an AndroidLauncher.java file, starting with the line "package com.mygdx.game.android;

My hunch is still that you changed the name.

Thanks for the explination. My java files do have the correct package name at the top!

package com.mygdx.game.android;

import android.os.Bundle;

import com.mygdx.game.MyGdxGame;

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


##### Share on other sites

I think its a problem with the low level end of the IDE. As Eclipse's Android ADT sometimes glitches and makes a mess of itself. Please try the steps below:

1- Copy the code of the project.

2- Delete the project from the workshop.

3- Delete .android file in the Users folder.

4- Put the code again.

Problem still happening?

Delete gradle + libgdx and don't forget deleting their logs as well and reinstall them again.

I don't see the solution being something else really

##### Share on other sites

I think its a problem with the low level end of the IDE. As Eclipse's Android ADT sometimes glitches and makes a mess of itself. Please try the steps below:

Will try some of these when I get some time today but I'm not using eclipse and have already tried copying the project to a new folder, although I haven't tried re-installing my tools.

I've been devloping with gedit and gradle through the terminal.

It's very odd. It has to be a bug!

1. 1
2. 2
Rutin
22
3. 3
4. 4
JoeJ
17
5. 5

• 14
• 30
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631774
• Total Posts
3002297
×