Frustrating linking issues when doing command line builds for Android- missing parent methods from SherlockFragmentActivity

Frustrating linking issues when doing command line builds for Android- Gradle fails to recognize SherlockFragmentActivity having method onResumeFragments, getChildFragmentManager, etc.

Gradle fails to build an android project depending on several compiled library projects. (Everything builds in Eclipse). I have a structure as follows:


Everything works when I build at the library level, but when I build at the /root level (whose settings includes all of the appropriate subprojects), I get errors like those that follow:

/path_to_my_activity/ cannot find symbol
: method onResumeFragments()
location: class

It doesn’t believe that MyActivity, which descends from MyProprietaryActivity, which descends from SherlockFragmentActivity, which descends from Watson, which descends from (support) FragmentActivity, has method onResumeFragments (or getChildFragmentManager).

Now, all of my build.gradle files have the same

dependencies {
 compile ''

And they all reference MavenCentral (I didn’t get to this point in compilation until that happened). Why is this the case? I have heard of interfering libraries causing problems in this case, but if, instead of pulling from MavenCentral, I include copes of the same android support library, I get tons of these:

java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompatHoneycomb;

Why is this happening, and what is the solution? I’m building from the command line because I’m trying to use gradle to make an automated build. (Note: I am including the android-library and android plugins appropriately. I have done this with hand-made build.gradle files as well as Eclipse-exported build.gradle files. None of them build.)