Intellij IDEA不会从gradle导入依赖项,也不会标记src dirs

时间:2013-11-02 08:35:47

标签: android intellij-idea gradle android-gradle

现在您可以在屏幕截图中看到我的项目是什么样的。我的gradle构建文件如下所示。即使在jetgradle中单击更新项目后问题仍未解决。我应该注意到它不是安卓工作室而是干净的IDEA 12.1.6

apply plugin: 'java'


allprojects {
    apply plugin: 'idea'
}

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.1'
    }
}

dependencies {
    compile project(':opp-client')
}

project(':opp-client') {

    apply plugin: 'android'

    repositories {
        mavenCentral()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots/"
        }
        maven {
            url "https://github.com/dahlgren/vpi-aar/raw/master"
        }
    }

    dependencies {
        compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
        compile 'com.nineoldandroids:library:2.4.0'
        compile 'ch.acra:acra:4.5.0'
        compile 'com.googlecode.libphonenumber:libphonenumber:5.8'
        compile 'org.simpleframework:simple-xml:2.7.1'
        // compile 'com.viewpagerindicator:library:2.4.1@aar'
        compile 'org.roboguice:roboguice:2.0'
        compile 'com.google.code.findbugs:jsr305:2.0.2'
        compile 'com.google.guava:guava:14.0.1'
        // provided 'com.github.rchugunov:android:4.2-SNAPSHOT'
        compile 'com.github.rchugunov:android-support-v4:r18-SNAPSHOT'
        compile 'com.github.rchugunov:google-analytics:2.0-beta5-SNAPSHOT'
        compile 'com.github.rchugunov:flurry:3.2.2-SNAPSHOT'
        compile 'com.github.rchugunov:parse:1.3.0-SNAPSHOT'
        compile 'com.github.rchugunov:list-view-animations:1.0-SNAPSHOT'
        compile 'com.github.rchugunov:appcompat-v7:r19-SNAPSHOT@aar'
        compile 'com.github.rchugunov:swipelistview:1.0-SNAPSHOT@aar'
        compile 'com.viewpagerindicator:library:2.4.2-SNAPSHOT'
    }

    android {
        compileSdkVersion 18
        buildToolsVersion '18.0.1'

        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src/main/java']
                res.srcDirs = ['res']
                assets.srcDirs = ['assets']
            }
        }
    }
}

idea sccreenshot

1 个答案:

答案 0 :(得分:1)

IntelliJ 12中的Gradle支持是有限的,大多数人使用Gradle"#34;#34;插件生成IntelliJ项目文件,而不是使用IntelliJ" JetGradle"插入。但我不知道这对Android项目有多好。 IntelliJ 13(EAP)和Android Studio(基于IntelliJ 13)具有更好的Gradle支持。