2

错误:(41, 13) 无法解决: com.rarepebble:colorpicker:1.6.0 和错误:(42, 13) 无法解决: com.vstechlab.easyfonts:easyfonts:1.0.0 和错误:(40, 13 ) 无法解决:petrov.kristiyan.colorpicker:colorpicker-library:1.0.3

gradle.build(模块:lib)

    apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'
//apply from: '../.publishing/sonatype.gradle'

archivesBaseName = 'android-crop'
ext {
    PUBLISH_GROUP_ID = 'com.vstechlab'
    PUBLISH_ARTIFACT_ID = 'easyfonts'
    PUBLISH_VERSION = '1.0.0'
}

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 22

        testApplicationId 'com.soundcloud.android.crop.test'
        testInstrumentationRunner 'android.test.InstrumentationTestRunner'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.android.support:support-annotations:23.0.1'
    compile 'com.android.support:support-v4:23.0.1'
    androidTestCompile 'com.squareup:fest-android:1.0.7'
    androidTestCompile 'com.android.support:support-v4:23.0.1'
    androidTestCompile 'org.mockito:mockito-core:1.9.5'
    androidTestCompile 'com.google.dexmaker:dexmaker:1.0'
    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'petrov.kristiyan.colorpicker:colorpicker-library:1.0.3'
    compile 'com.rarepebble:colorpicker:1.6.0'
    compile 'com.vstechlab.easyfonts:easyfonts:1.0.0'

}
apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'

模块示例

    apply plugin: 'com.android.application'

archivesBaseName = 'android-crop-example'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 22
        versionCode Integer.parseInt(project.VERSION_CODE)
        versionName project.VERSION
        renderscriptTargetApi 19
        renderscriptSupportModeEnabled true
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {


    compile project(':lib')
    compile fileTree(dir: 'libs', include: ['*.jar'])


}

模块 NC

 buildscript {
    repositories {
        mavenCentral()
        maven {
            url 'https://dl.bintray.com/vsvankhede/maven/'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
    }
}

allprojects {
    group = 'com.soundcloud.android'
    version = project.VERSION

    repositories {
        mavenCentral()
    }
}

设置等级:

include ':lib', ':example'

当我尝试运行项目时出错

i  tried and got these all   seee.......

    >Error:A problem occurred configuring project ':example'.
> A problem occurred configuring project ':lib'.
   > Could not resolve all dependencies for configuration ':lib:_debugCompile'.
      > Could not find petrov.kristiyan.colorpicker:colorpicker-library:1.0.3.
        Searched in the following locations:
            https://repo1.maven.org/maven2/petrov/kristiyan/colorpicker/colorpicker-library/1.0.3/colorpicker-library-1.0.3.pom
            https://repo1.maven.org/maven2/petrov/kristiyan/colorpicker/colorpicker-library/1.0.3/colorpicker-library-1.0.3.jar
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/android/m2repository/petrov/kristiyan/colorpicker/colorpicker-library/1.0.3/colorpicker-library-1.0.3.pom
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/android/m2repository/petrov/kristiyan/colorpicker/colorpicker-library/1.0.3/colorpicker-library-1.0.3.jar
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/google/m2repository/petrov/kristiyan/colorpicker/colorpicker-library/1.0.3/colorpicker-library-1.0.3.pom
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/google/m2repository/petrov/kristiyan/colorpicker/colorpicker-library/1.0.3/colorpicker-library-1.0.3.jar
        Required by:
            com.soundcloud.android:lib:1.0.1
      > Could not find com.rarepebble:colorpicker:1.6.0.
        Searched in the following locations:
            https://repo1.maven.org/maven2/com/rarepebble/colorpicker/1.6.0/colorpicker-1.6.0.pom
            https://repo1.maven.org/maven2/com/rarepebble/colorpicker/1.6.0/colorpicker-1.6.0.jar
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/android/m2repository/com/rarepebble/colorpicker/1.6.0/colorpicker-1.6.0.pom
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/android/m2repository/com/rarepebble/colorpicker/1.6.0/colorpicker-1.6.0.jar
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/google/m2repository/com/rarepebble/colorpicker/1.6.0/colorpicker-1.6.0.pom
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/google/m2repository/com/rarepebble/colorpicker/1.6.0/colorpicker-1.6.0.jar
        Required by:
            com.soundcloud.android:lib:1.0.1
      > Could not find com.vstechlab.easyfonts:easyfonts:1.0.0.
        Searched in the following locations:
            https://repo1.maven.org/maven2/com/vstechlab/easyfonts/easyfonts/1.0.0/easyfonts-1.0.0.pom
            https://repo1.maven.org/maven2/com/vstechlab/easyfonts/easyfonts/1.0.0/easyfonts-1.0.0.jar
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/android/m2repository/com/vstechlab/easyfonts/easyfonts/1.0.0/easyfonts-1.0.0.pom
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/android/m2repository/com/vstechlab/easyfonts/easyfonts/1.0.0/easyfonts-1.0.0.jar
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/google/m2repository/com/vstechlab/easyfonts/easyfonts/1.0.0/easyfonts-1.0.0.pom
            file:/C:/Users/Altaf/AppData/Local/Android/sdk/extras/google/m2repository/com/vstechlab/easyfonts/easyfonts/1.0.0/easyfonts-1.0.0.jar
        Required by:
            com.soundcloud.android:lib:1.0.1
4

1 回答 1

2

错误:(41, 13) 无法解决: com.rarepebble:colorpicker:1.6.0
错误:(42, 13) 无法解决: com.vstechlab.easyfonts:easyfonts:1.0.0
错误:(40, 13) 失败解决:petrov.kristiyan.colorpicker:colorpicker-library:1.0.3

发生这种情况是因为这些库不在 MavenCentral 中

petrov.kristiyan.colorpicker:colorpicker-library:1.0.3.
com.vstechlab.easyfonts:easyfonts:1.0.0
com.rarepebble:colorpicker:1.6.0

检查例如此链接: https ://repo1.maven.org/maven2/petrov/kristiyan/colorpicker/colorpicker-library/1.0.3/colorpicker-library-1.0.3.pom

此链接不存在,它应该是使用上述库的 Maven Central 中的 pom 文件的链接。

可能您必须使用不同的 Maven 存储库。
我无法在 MavenCentral 或 Jcenter 存储库中找到它。

如果这些库在 github 上,您可以尝试使用jitpack

添加在root/build.gradle:

allprojects {
        repositories { 
            jcenter()
            maven { url "https://jitpack.io" }
        }
   }

然后在您的项目中使用:

  dependencies {
        compile 'com.github.User:Repo:Tag'
   }
于 2016-03-02T09:06:16.510 回答