Gradle project project for Android gradle in another directory tree

I have a project layout as follows:

MyProject/ Project/ build.gradle build.gradle settings.gradle thirdparty/ ActionBarSherlock/ actionbarsherlock/ build.gradle build.gradle settings.gradle 

The ActionBarSherlock directory is a git submodule that points to the ActionBarSherlock dev branch, which contains the gradle assembly files.

In MyProject/settings.gradle I added:

 include '..:thirdparty:ActionBarSherlock:actionbar' 

and in MyProject/build.gradle added:

 compile '..:thirdparty:ActionBarSherlock:actionbar' 

to the dependencies section. When I build MyProject/Project with gradle assemble , I get the following error:

 > Project with path '..:thirdparty:ActionBarSherlock:actionbar' could not be found in project ':MyProject' 

I can build the ActionBarSherlock separately using:

 cd thirdparty/ActionBarSherlock/actionbarsherlock gradle assemble cp build/libs/actionbarsherlock-4.3.2-SNAPSHOT.aar ../../../MyProject/Project/libs 

and then use it in the dependencies section of MyProject/build.gradle like:

 compile files('libs/actionbarsherlock-4.3.2-SNAPSHOT.aar') 

Now, when I build MyProject/Project , I get the following error:

 > Duplicate files at the same path inside the APK: AndroidManifest.xml 
+4
source share
1 answer

This google group has a response from Android SDK developer Xavier Ducroet. https://groups.google.com/forum/#!topic/adt-dev/bPY_Un8BsBY

Quote:

Depends on the gradle project, which outside of your main project, you can try to do the following:

enable 'abs'

project (': abs'). projectDir = new file ('/ some / path / relative / or / absolute')

Note that your application should use the dependency using the project (': abs'), since the path is gradle: abs no matter what the path is on disk.

+2
source

Source: https://habr.com/ru/post/1484654/


All Articles