Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (686)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [SOLVED]libgdx and eclipse problem (newbie)  (Read 11543 times)
0 Members and 1 Guest are viewing this topic.
Offline philfrei
« Posted 2013-08-01 02:42:42 »

I've newly downloaded and am running the LibGDX project setup tool and it creates a new project just fine. Upon importing to Eclipse (Juno), I get this message in the console (several times):

[2013-07-31 19:07:51 - AngryMasons-android] Unable to resolve target 'android-15'

In the Problems, the first error (for the android project) is this:
The GWT SDK JAR gwt-servlet.jar is missing in the WEB-INF/lib directory   lib   /AngryMasons-html/war/WEB-INF   Unknown   Google Web Toolkit Problem

The second problem seems kind of bizarre also:
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project   AngryMasons-android      Unknown   Java Problem

The AngryMasons-android project does not include "GWT SDK" library or the "JRE System Library[jre7]" or "App Engine SDK". Should it? If I manually add these libraries, it does no good.

A "quick fix" on the gwt-servlet.jar error does put a copy into the -html/war/WEB-INF. But the other errors remain.

After the jre7 library is added, there is this:
The project was not built since its build path is incomplete. Cannot find the class file for Fix the build path then try building this project   AngryMasons-android      Unknown   Java Problem

And, on the code page that was generated, the very first import has an error:
The import android.os.Bundle cannot be resolved

Where is this library normally found?

I could go on listing errors but they are probably just cascades from the first errors, right?

Any help would be much appreciated. I'm quite stuck.

music and music apps:
Offline Jimmt
« League of Dukes »

JGO Kernel

Medals: 165
Projects: 5
Exp: 3 years

« Reply #1 - Posted 2013-08-01 03:11:08 »

You've probably already seen this in the setup tutorial, but you need the Android SDK...
Offline philfrei
« Reply #2 - Posted 2013-08-01 06:33:16 »

Oh--Android doesn't play well with Java 7?  Cranky I have to go back and reload Java 6?  Cranky

I was working with the "Prerequisites" link just above this tutorial, and then the tool "gdx-setup-ui.jar". I didn't think to look at the Manual Project Setup.
If Android doesn't work with Java 7, why does the "Prerequisites" link for Java JDK point to...Java 7?  Huh

I may be kind of dense, but it kind of bugs me that the link to loading the Android SDK on an existing IDE points to a page that prominently displays a bundle that includes Eclipse, and the download for just the Android SDK is buried in the "Other platforms" area. I missed that twice.

I'm very tempted to just download the bundle and work with multiple Eclipse copies. Yay, another 200+ MB download!

(grousing aside, I do thank you, Jimmt for the link)
(and it is simply amazing that all this technology is free)

music and music apps:
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #3 - Posted 2013-08-01 07:18:58 »

I've newly downloaded and am running the LibGDX project setup tool and it creates a new project just fine. Upon importing to Eclipse (Juno), I get this message in the console (several times):

[2013-07-31 19:07:51 - AngryMasons-android] Unable to resolve target 'android-15'

When I was using the project setup tool a few days ago I found that regardless of what I entered in the tool setup options, the generated project was always dependant on release 15 of the android sdk.

Assuming you've downloaded the latest one (which I think is 18) then it's easiest to open the .project and Android-Manifest.xml files in the -android project and manually alter it.

Edit: When you do modify it, make sure to restart Eclipse, then do a full clean/rebuild.

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline gimbal

JGO Knight

Medals: 26

« Reply #4 - Posted 2013-08-01 11:23:20 »

I wonder: would using a Java 7 JDK but setting the compiler (in the workspace or project preferences) to Java 1.6 compliance work? The linked documentation states that you need to be using Java 1.6, but it does not state if you need to physically install a Java 6 JDK.
Offline philfrei
« Reply #5 - Posted 2013-08-01 18:47:42 »

I'm struggling with this mightily because of everything being new.

The Android SDK Manager shows that I have Android 4.3 (API 18). The game-android project's "AndroidManifest.xml" lists the "targetSdkVersion" as 17. I changed this to 18.

To 'reload' the project, I did the following:
(1) closed & reopened Eclipse (2) Project/clean, selecting the project files, (3) Refresh <F5> on the project itself.

Same errors.

About the JRE7--I loaded a separate tutorial/example from Google/Android that demos a "GreetingService", and it is running fine, but the project is structured very differently. It has a copy of the jre7 library listed, so this makes me wonder if the presence of jre7 is really the problem. This tutorial project has the following libs and structures NOT in the game-android project generated by libgdx's project setup tool:

App Engine SDK [App Engine - 1.8.2]  (all the jars are listed as being in an Eclipse plugins folder)
GWT SDK [gwt-2.5.1 - 2.5.1]  (all jars are listed from a download I had done of the toolkit and stored on my desktop/Java/gwt file folder)
JRE System Library [jre7]

And of course there are things like a war file folder, and WEB-INF, which I presume are not used for an Android program or the Android emulator.


I just tried manually adding the jre6 rather than the jre7 to the game-android project as a library. I don't think it made any difference. The error about the class Object not being found goes away, but the other errors remain. The first problem listed is now (as before):
"Cannot find class file for " etc. a build path issue.
Also, the class file MainActivity's first error is on the import line:
"import android.os.Bundle;"

Any thoughts where one might find these?

I've download the "bundle" that includes a version of Eclipse with plugins already set up (presumably). Haven't tried installing that yet and seeing if the game-android project works any better in that context. I also have yet to go through the manual install tutorial in detail. I guess I'll do that next (after a search for "" or "android.os.Bundle").

Dang. Three days lost on my "schedule" due to this. Am wondering, maybe just delete the -android emulation and go forward with the rewrite of my game based on the -desktop and -html only. Worry about the -android version later? I kind of wanted to get the whole libgdx thing working first and finish Dustin Riley's tutorials as a first step in getting acquainted with libgdx.

music and music apps:
Offline philfrei
« Reply #6 - Posted 2013-08-01 19:29:14 »


android.os.Bundle and are part of the "android.jar" that was stored at a subfolder of the location listed by the Eclipse "SDK Path" listed in the Android SDK manager.


Why wouldn't the setup automatically include a path to this jar? (The SDK path listed ends on "android-sdk".) Did I configure something incorrectly?

I tried explicitly linking this as an "external jar" and all the errors in the MainActivity class go away. What I have now are a series of these errors:

Unable to resolve target 'android-15'
Unable to resolve target 'android-15'
Unable to resolve target 'android-15'
Unable to resolve target 'android-15' until SDK is loaded.
Unable to resolve target 'android-15' until SDK is loaded.
Unable to resolve target 'android-15' until SDK is loaded.

Any ideas?

music and music apps:
Offline Herjan
« Reply #7 - Posted 2013-08-01 19:32:50 »

Yes, go to android project, rightclick, Properties -> Android and check your Android x.x.x Android 4.2.2 for example Grin Good luck coding!
Offline philfrei
« Reply #8 - Posted 2013-08-01 20:30:19 »

Thank you!
All problems/errors are gone.

I've been working through the "manual" project start and was just noticed that Eclipse's new project/Android project automatically adds the Android 4.3 library.

Clicking the properties/Android/Project Build Target: Android 4.3 seems to have accomplished the same thing with the project made via the libgdx project setup tool. Perhaps this could/should be added as another step in the libgdx project building tool, along with the instructions for correcting the "warnings" that come with some jars that need synchronizing?

This gets rid of the ridiculous error where java's Object.class was not found. I can delete the manual addition of the jre6 as a library.

There are still a couple of differences. The "manually" created android project had "android-support-v4.jar" automatically included, and the libgdx setup tool android projects does not. There are a couple differences in terms of whether other jars are in the "Android Private Libraries" or "Referenced Libraries" in the two projects. But I'm guessing this doesn't matter, and I'll worry about the "android-support-v4.jar" presence later.

OK, on with the game tutorial!  Smiley

music and music apps:
Offline Herjan
« Reply #9 - Posted 2013-08-01 22:03:27 »

Ah, nice everything works now Wink

I hope your tutorial isn't starting with making menus as they are really complicated/confusing in LibGDX and I had a lot of trouble with making them as there are 1000 texture packers and only 1 properly works, (with 9patches), it was just very confusing for me, as this text is for you since you don't know what texture packers/9patches are...

Now I know how it works, its great stuff, but all those youtube guys who teach beginners and start direct with making a menu for their game... Bad job... And the most terrifying thing is that they don't even explain what they do... Bucky has to do a LibGDX tutorial, oO!

Nonetheless, LibGDX itself is great!
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (61 views)
2015-11-07 13:29:08

Rems19 (74 views)
2015-10-31 01:36:56

Rems19 (67 views)
2015-10-31 01:32:37

williamwoles (103 views)
2015-10-23 10:42:59

williamwoles (90 views)
2015-10-23 10:42:45

Jervac_ (103 views)
2015-10-18 23:29:12

DarkCart (131 views)
2015-10-16 00:58:11

KaiHH (113 views)
2015-10-11 14:10:14

KaiHH (153 views)
2015-10-11 13:26:18

BurntPizza (165 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!