Android Studio 0.5.1的Gradle同步问题

时间:2014-03-10 02:51:15

标签: android-studio android-gradle build.gradle

自更新到AS 0.5.1以来,我无法同步我的项目。 Gradle给了我以下警告:

No signature of method: static com.google.common.collect.ArrayListMultimap.create() is applicable for argument types: () values: []
Possible solutions: clear(), grep(), get(java.lang.Object), get(java.lang.Object), getAt(java.lang.String), isCase(java.lang.Object)

它没有指向我的build.gradle文件中可能导致问题的任何内容,所以我很遗憾从哪里开始。

修改:尝试运行gradle build时,我在应用Android插件时遇到此问题:

A problem occurred evaluating root project 'tve-android'.
> Could not create plugin of type 'AppPlugin'.

我的build.gradle文件:

buildscript {
    repositories {
        mavenLocal()
        maven {
            url "http://nexus.products/nexus/content/groups/public"
        }
    }

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

apply plugin: 'android'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
apply plugin: 'pmd'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.2"

    defaultConfig.minSdkVersion = 16
    defaultConfig.targetSdkVersion = 19
    defaultConfig.testInstrumentationRunner = 'android.test.InstrumentationTestRunner'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    sourceSets {
        main.java.srcDirs = ['src/main/java']
        main.resources.srcDirs = ['src/main/resources']
        main.res.srcDirs = ['src/res']
        main.assets.srcDirs = ['src/assets']

        androidTest.java.srcDirs = ['src/test/java']
        androidTest.resources.srcDirs = ['src/test/resources']
        androidTest.res.srcDirs = ['src/res']
        androidTest.assets.srcDirs = ['src/assets']
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}

dependencies {
    compile 'com.android.support:support-v4:19.0.+'
    compile 'commons-io:commons-io:2.+'
    compile 'commons-lang:commons-lang:2.+'
    compile 'com.loopj.android:android-async-http:1.4.+'
    compile 'com.jakewharton:disklrucache:1.0.0'
    compile 'net.jpountz.lz4:lz4:1.1.1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.1'
    androidTestCompile 'com.google.dexmaker:dexmaker:1.+'
    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.+'
    androidTestCompile 'org.mockito:mockito-core:1.9.+'
}

2 个答案:

答案 0 :(得分:1)

还需要将gradle升级到v1.10。

答案 1 :(得分:0)

我遇到了同样的问题,我只是通过重新导入我的gradle项目来快速修复它。