Howto integrate appcompat with LibGDX's Gradle Projects?

Anything libgdx related goes here!

Howto integrate appcompat with LibGDX's Gradle Projects?

Postby Omega » Fri Jun 06, 2014 8:13 pm

Dilemma:
I am attempting to merge a pre-existing Android project that uses appcompat with a game written using LibGDX. The problem is, I have no clue how to tell Gradle I need appcompat. I've tried adding appcompat via the usual method (https://developer.android.com/tools/support-library/setup.html, see the section labeled "Adding libraries with resources") and while this works for a regular project, it fails for the LibGDX's Gradle one. Where there is usually a check-mark verifying that a library project was added successfully, this just has a red x.

Screenshots of Properties Pages:
Image

Example Errors due to this problem:
Code: Select all
Error retrieving parent for item: No resource found that matches the given name '@style/Theme.AppCompat'.


What I have tried:
I've tried adding it via the "traditional," aforementioned means as well as putting the following in my top-level Android, Gradle dependencies block:
Code: Select all
dependencies {
    ...
    compile "com.android.support:appcompat-v7:18.0.+"
}


So my question is, how do I build a LibGDX project with appcompat using Eclipse?
Last edited by Omega on Mon Jun 09, 2014 12:59 pm, edited 1 time in total.
Omega
 
Posts: 2
Joined: Fri Jun 06, 2014 8:07 pm

Re: Integrating appcompat with LibGDX's Gradle Projects

Postby Zhuinden » Sun Jun 08, 2014 10:24 am

I am curious to hear an answer to this as well.. :|
Zhuinden
 
Posts: 5
Joined: Sat Jun 07, 2014 6:12 am

Re: Integrating appcompat with LibGDX's Gradle Projects

Postby Omega » Mon Jun 09, 2014 12:57 pm

*bump*
I still need help with this issue!
Omega
 
Posts: 2
Joined: Fri Jun 06, 2014 8:07 pm

Re: Howto integrate appcompat with LibGDX's Gradle Projects?

Postby Fisherman » Sun Nov 09, 2014 3:08 am

did you figure this out? I need to do the exact same thing.

I managed to add appcompat dependency into gradle and it builds just fine
Code: Select all
dependencies {
   compile fileTree(dir: 'libs', include: '*.jar')
   compile 'com.google.android.gms:play-services:+'
   compile 'com.android.support:appcompat-v7:+'
}


but now the eclipse adt thinks that there are no local libs added to the project so it hits error at my resource files.

So my question is how to fool eclipse (ADT) into thinking that all local libs are there?
Fisherman
 
Posts: 182
Joined: Sun Nov 18, 2012 11:48 pm

Re: Howto integrate appcompat with LibGDX's Gradle Projects?

Postby Fisherman » Sun Nov 23, 2014 2:49 am

OK sort answer: Intergrating appcompat with LibGDX using Gradle on Eclipse is NOT possible. While Gradle plugin will work fine, ADT plugin throws errors monstly on missing styles and stuff so u have a few choices.

1. If you wanna use eclipse just load the appcompat_v7 as a normal library project within eclipse, add it via "add" from android options and tell gradle to build the local dependecies
2. Use intellij
3. Brace yourself as Eclipse team is planning to improve and maintain ADT + Gradle via a project called "Andmore"
Fisherman
 
Posts: 182
Joined: Sun Nov 18, 2012 11:48 pm


Return to Libgdx

Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 1 guest