New android build system and circular dependencies

1,128 views
Skip to first unread message

Dmitriy Tarasov

unread,
Aug 5, 2013, 3:05:17 AM8/5/13
to adt...@googlegroups.com
Hello, all

I stuck with a problem with a new great build system. I asked a quiestion on stackoverflow but anybody can't help me (link)

The problem is with circular dependencies between the modules. I have an android app module and android library module which depends on each other. IntelliJ IDEA in project settings warn me about this, but succesfully builds my project. The problem is that I can't create the same build configuration with gradle. If I declare circular dependency in my build.gradle files I've get an error: 

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > Module version project:app:unspecified depends on libraries but is not a library itself

How can I achieve the same result with new build system?

Jake Wharton

unread,
Aug 5, 2013, 11:25:27 AM8/5/13
to adt...@googlegroups.com
Dependencies are a directed acyclic graph. To fix a circular dependency you can either simply extract that code into a new module which both the existing library and app depend on or you can depend on an interface in the library and make the code in the app implement that interface.

--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages