wmora/martianrun

Can't find google play services, Build Model fails

Closed this issue · 11 comments

Hey there,

I'm trying to include your project in a teaching curriculum (simply as something to deconstruct at the end of the course, not majorly incorporated), but I can't seem to get it to build. The error output is as follows:

FAILURE: Build failed with an exception.

Clearly we just need to point it to the right rpository for Google Play Services, or I need to get the right version locally, but I wasn't quite sure how to do it.

I was able to work around the issue by just removing the compile instruction for GPS, but then obviously I can't build android builds. Desktop builds work just fine, though, so I think I can still work with this!

Yours is the first libGDX game I've been able to get running on Windows in Eclipse, after trying quite a few! Thanks for putting all of this up!

wmora commented

@mtschoen sorry for the late response. I think that you are missing GPS in your android home. Have you checked that it's installed?

Hm. I just tried again on another computer, made sure to get GPS in the SDK manager, and tried to update the version in build.gradle to the latest (7.0.0) but gradle seems to be looking in the wrong location. Maybe it's looking for the place where Android Studio puts the SDK?

I tried setting ANDROID_HOME, as well, but to no avail.

wmora commented

are you compiling the project from Android Studio or the command line? If it's from the command line, make sure you have your ANDROID_HOME set up either as an environment variable or in the project's local.properties. If you are running it from Android Studio, make sure you are working with the Gradle wrapper included in the project and not your local Gradle installation, maybe there's something misconfigured

Actually I'm using Eclipse...

wmora commented

Oh... I haven't worked with Gradle + Eclipse, but have you tried compiling from the command line? I just cloned it in a different computer and running "./gradlew assemble" worked fine.

Look at #1, not sure if it's related.

Hm. Gradlew assemble has the same result. Also I'm on Windows. I can try Android Studio, but I've never used it or IntelliJ before, so I'd like to stay with Eclipse.

Anyway I'm able to get away with just building the desktop version and removing the android build target. Do you think you could give it a shot in Eclipse? What version of GPS should I be pointing to?

wmora commented

sure, I'll try Eclipse and will let you know. Any GPS version with ads support and basic google game services will do, 4.4.52 works fine.

One more thing, check that google play services is indeed in your Android SDK. All installed versions should be in %ANDROID_HOME%/extras/google/m2repository/com/google/android/gms/play-services/

wmora commented

@mtschoen I got it to build in Eclipse, sorry :-/

Hm, so it must be a windows thing then (i assume you're on osx or linux?)

My android sdk doesn't follow the same directory structure, which is odd. I wonder if this is just a problem with gradle or libgdx in general. 8 can find gps, but its in sdk/extras/google, no m2repo folder...

Thanks for your help, btw. I appreciate your time :)

wmora commented

I'm on osx, yes. Hope you get it to work and let me know if you have any other questions :)

Thanks. I might try installing android studio and getting the sdk installed where gradle expects it, but I'm not hopeful. That said, yours was the first open source project i could actually get to compile and run at all, so hooray!