Android Studio RC 1 Gradle构建在更新后不会编译

时间:2014-12-02 15:48:10

标签: build gradle android-studio libraries aar

在互联网上进行密集搜索后,我找不到任何问题的答案。在我将android studio从beta升级到rc1之后,gradle构建脚本停止了以下错误:

Error:String index out of range: -1

我的构建脚本如下:

apply plugin: 'com.android.application'

repositories {
    jcenter()
    flatDir {
        dirs 'libs'
    }
}

android {
    compileSdkVersion 21
    buildToolsVersion '21.1.1'

    defaultConfig {
        applicationId 'myappidhere'
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName '1.0'
    }
    lintOptions {
        abortOnError false
    }

    android {
        sourceSets {
            main {
                manifest.srcFile 'src/main/AndroidManifest.xml'
                java.srcDirs = ['src/main/java', 'src/main/java-gen']
                res.srcDirs = ['src/main/res']
            }
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:21.0.2'
    compile 'com.android.support:support-v4:21.0.2'
    compile 'com.android.support:recyclerview-v7:21.0.0'
    compile 'com.jakewharton:butterknife:6.0.0'
    compile 'com.jakewharton.timber:timber:2.5.0'
    compile 'de.greenrobot:greendao:1.3.7'
    compile 'com.rengwuxian.materialedittext:library:1.5.0'
    //local libs
    compile(name: 'utilsaaa1', ext: 'aar')
    compile(name: 'pixlui_1_0_5_fork', ext: 'aar')
    compile project(':Secure_preferences_lib')
}

阅读了gradle log错误后,有问题的行如下:

 compile(name: 'utilsaaa1', ext: 'aar')
        compile(name: 'pixlui_1_0_5_fork', ext: 'aar')

这两个文件都在文件夹libs中。 我不知道如何解决这个问题,所以任何帮助都会受到赞赏。

EDIT1:idea.log

Caused by: org.gradle.api.IllegalDependencyNotation: Supplied String module notation 'utilsaaa1' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.

1 个答案:

答案 0 :(得分:1)

变化:

 compile(name: 'utilsaaa1', ext: 'aar')

要:

 compile 'myappidhere:utilsaaa1:1.0@aar'