在Android studio中添加Picasso库时出错

时间:2014-05-10 10:25:04

标签: android maven android-studio picasso

我正在使用Eclipse,我在libs文件夹中有(picasso.jar),然后我生成了Gradle build然后切换到Android studio。但是毕加索图书馆停止了工作。

我的项目结构如下:

ProjectStructure--> dependices--> library dependices -->picasso.

这是错误:

  

错误:配置根项目' HomePage'时出现问题。   无法解析配置':_ debugCompile'的所有依赖项。   找不到与com.squareup匹配的任何版本:picasso:2.2。+。        要求:            :首页:未指定

的build.gradle

   buildscript {
repositories {
    mavenCentral()
}

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

dependencies {
compile project(':libraries:process_library')
 compile 'com.squareup:picasso:2.2.+'
    }

      android {
compileSdkVersion 19
buildToolsVersion '19.0.3'
defaultConfig {
    minSdkVersion 14
    targetSdkVersion 19
}

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

    // 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')
}

}

为了让毕加索图书馆再次运作,我该怎么做?

1 个答案:

答案 0 :(得分:0)

这是Android Studio中的错误;它为毕加索提供了错误的依赖。在build.gradle中,更改以下行:

compile 'com.squareup:picasso:2.2.+'

到此:

compile 'com.squareup.picasso:picasso:2.2.+'

我已经为此提出了错误:https://code.google.com/p/android/issues/detail?id=69509