I have gradle project with 4 subprojects and I 'm using idea plugin to generate idea project and modules. One of the subprojects is android module.
Here is it's build.gradle code:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.6'
}
}
apply plugin: 'android'
android {
buildToolsVersion "18.1.1"
compileSdkVersion 16
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aild.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
repositories {
mavenCentral()
}
dependencies {
compile(
['org.atmosphere:wasync:1.1.0'],
['org.codehaus.jackson:jackson-mapper-lgpl:1.9.13'],
['org.projectlombok:lombok:0.+'],
['org.apache.httpcomponents:httpmime:4.3.1'],
['commons-io:commons-io:2.+'],
['com.google.guava:guava:14.+']
)
compile fileTree(dir: 'libs', include: '*.jar')
}
The problem is: when using "gradle idea" to generate intellij idea modules, resulting android module is missing dependencies and I can't figure out why. Is something wrong with my config?
Other subprojects (using java plugin) have dependencies imported in idea modules without problems.
I am using gradle 1.7.
We can configure the settings for how IntelliJ IDEA syncs with Gradle by pressing the settings icon in the Gradle tool window, and selecting Auto-Reload Settings. We can set IntelliJ IDEA to automatically reload the project after "Any changes" in the build script files, so changes are automatically reloaded.
Importing gradle project in Idea solved the problem of dependencies not being imported for android module, but caused a bunch of more (and worse) problems described in this question: IntelliJ, Android and Gradle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With