1

I have an android project that uses several libraries:

  • play-services for analytics,
  • appcompat-v7 for the actionar,
  • and others... (for ads, in-app...)

I used to use APKLIB packaging and I was able to generate the APK of my project, but having hundreds of errors in Eclipse. So my intention is to fix this for not having any error at all }:-)

I discovered the AAR format and all this gradle staff, but I'd like to keep using my maven structure as it is.

So I got the AAR package of play_services (thanks to https://github.com/mosabua/maven-android-sdk-deployer) and generated the AAR package of appcompat-v7 and the others libs.

And I almost made this happen, excepting some errors with styles and other missing resources from those libs that are still not found:

Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').   
Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.AppCompat.Light').    

This is an example of some of my dependencies:

    <dependency>
      <groupId>com.google.android.gms</groupId>
      <artifactId>play-services</artifactId>
      <version>5.0.77</version>
      <type>aar</type>
    </dependency>
    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android</artifactId>
        <version>4.1.1.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>android.support</groupId>
        <artifactId>compatibility-v7-appcompat</artifactId>
        <version>20.0.0</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>android.support</groupId>
        <artifactId>compatibility-v7-appcompat</artifactId>
        <version>20.0.0</version>
        <type>aar</type>
    </dependency>
    <dependency>
        <groupId>android.support</groupId>
        <artifactId>compatibility-v4</artifactId>
        <version>20.0.0</version>
    </dependency>

My questions are:

  • Does it worth to forget Maven and move to Gradle for using Android apps? (Please say no :)
  • Is it not possible to get the dependencies resources using AAR packaging? I don't want to import all my projects in Eclipse for having access to their resources.
nano
  • 2,511
  • 4
  • 25
  • 42

1 Answers1

-4

Move to Gradle, it might pay off the effort you have to do to fix it. These new google libraries are more and more made for Gradle. Android-Maven-Plugin isn't mature enough to work well with AAR files the way APKLIB used to work, so it might require a lot of little adaptations. So if that is the case, I would recommend to spend this precious time with Gradle instead.

Note: by "moving to Gradle" it doesn't necessarily mean that you have to switch to Android Studio. You can still use this great IDE that Eclipse is ;-)

Alécio Carvalho
  • 13,481
  • 5
  • 68
  • 74
  • Could you link to some resources explaining how to correctly use Gradle for Android projects within Eclipse, or expanding on that point yourself? AFAIK Gradle support on Eclipse is subpar compared with e.g. Maven on Eclipse or Gradle on Android Studio, and I have yet to find someone describing a reliable way to manage Gradle-based Android projects within Eclipse. – Giulio Piancastelli Aug 08 '14 at 15:45
  • That is true, with regards the IDE integration with Eclipse, only the editor works well. I personally prefer using Gradle on command line, so basically Eclipse would be used only for the editing. You can basically use Eclipse on the standard way (i.e. adding additional projects as android-library projects) and use Gradle only to perform the release builds (official builds) and for a continuous integration build. On the integration aspect, Android Studio is 'top', but on the other aspects of IDE, i still prefer to stick with Eclipse. – Alécio Carvalho Aug 08 '14 at 16:20
  • By the way, this link is a mandatory read for Gradle with Android: http://tools.android.com/tech-docs/new-build-system/user-guide – Alécio Carvalho Aug 08 '14 at 16:22