ZBarScannerActivityLib

ZBarScannerActivityLib

我从ZBarScannerActivityLib库项目的命令行执行 gradle build 时遇到此错误。
详细错误信息如下

*配置项目':ZBarScannerActivityLib'时发生问题。



ZBarScannerActivityLib的 build.gradle文件

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
    }
}
apply plugin: 'android-library'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
}

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
            jniLibs.srcDir 'libs'
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

最佳答案

添加

 classpath 'com.android.tools.build:gradle:2.1.3'

关于android - 无法解析配置 ':ZBarScannerActivityLib:classpath'的所有依赖项,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40406309/

10-13 04:31