android - 错误 :(41, 13) 无法解析 : com. 稀有卵石 :colorpicker:1. 6.0

标签 android gradle android-gradle-plugin jitpack

Error:(41, 13) Failed to resolve: com.rarepebble:colorpicker:1.6.0 and Error:(42, 13) Failed to resolve: com.vstechlab.easyfonts:easyfonts:1.0.0 and Error:(40, 13) Failed to resolve: 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'])


}

模块数控

 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

最佳答案

Error:(41, 13) Failed to resolve: com.rarepebble:colorpicker:1.6.0
Error:(42, 13) Failed to resolve: com.vstechlab.easyfonts:easyfonts:1.0.0
Error:(40, 13) Failed to resolve: 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'
   }

关于android - 错误 :(41, 13) 无法解析 : com. 稀有卵石 :colorpicker:1. 6.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35742048/

相关文章:

android - 如何为启动画面添加不同的图像

Java Android 如何让 ImageView onClick 变暗

android - Android Gradle 插件无法识别 SourceSet 'instrumentTest'

android - 我在构建 gradle 时遇到此错误错误 :Execution failed for task ':app:processDebugResources' . > 没有从属进程来处理作业,正在中止

javascript - 在 react native 应用程序上运行 expo run 时出错

android - 为偏好 Activity 提供我自己的 ListView

android - 警告:API 'variant.getMergeResources()'已作废,并已替换为 'variant.getMergeResourcesProvider()'

android - 如何在Android Studio中将jar文件放置在SDK之前?

java - 无法使用 Gradle 和 Kotlin 运行生成的 JAR 文件

android - 更改 minSdkVersion 后的 java.lang.UnsatisfiedLinkError