Anu*_*bis 11 android gradle zbar
由于某些未知原因,Gradle拒绝下载我放在gradle.build文件中的所有依赖项.我试图获得'me.dm7.barcodescanner:zbar:1.7'的依赖性,但每次我尝试同步我的gradle它只会给我以下错误:
Error:(6, 13) Failed to resolve: me.dm7.barcodescanner:zbar:1.7
Run Code Online (Sandbox Code Playgroud)
它不仅仅是zbar库,它的每个库都不是com.android库.我不是处于离线模式,所以也不可能.我的.build文件中有什么问题吗?
apply plugin: 'com.android.application'
dependencies {
compile fileTree(include: '*.jar', dir: 'libs')
compile project(':MetaioSDK')
compile 'com.android.support:support-v4:22.0.0'
compile 'me.dm7.barcodescanner:zbar:1.7'
}
android {
compileSdkVersion 19
buildToolsVersion "21.1.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['../../templatesContent_crossplatform']
}
// 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')
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
Run Code Online (Sandbox Code Playgroud)
Anu*_*bis 11
好吧,设法解决它.在依赖项块中添加了这个:
repositories {
mavenCentral()
}
Run Code Online (Sandbox Code Playgroud)