首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jitpack:用示例库(Android )解析失败

Jitpack:用示例库(Android )解析失败
EN

Stack Overflow用户
提问于 2019-09-23 12:19:08
回答 1查看 2K关注 0票数 1

我不能使用jitpack导入任何库。我的问题在于我自己的库,但是下面的com.github.jitpack:android-example:1.0.4是由jitpack自己提供的一个示例库,这个库应该是现成的。还请注意,在android演播室中,离线的东西是关闭的。

根build.gradle

代码语言:javascript
复制
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}
allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { 
            name "jitpack"
            url "https://jitpack.io" 
        }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

App build.gradle

代码语言:javascript
复制
apply plugin: 'com.android.application'
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.me.stuff"
        minSdkVersion 26
        targetSdkVersion 28
        versionCode 1
        versionName "1.4"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    productFlavors {
    }
}
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.0.0'
    // etc...
    implementation 'com.github.jitpack:android-example:1.0.4'
}
configurations.all {
    resolutionStrategy {
        //force 'com.android.support:support-annotations:27.1.1'
    }
}

错误信息

安卓工作室展示:

代码语言:javascript
复制
ERROR: Failed to resolve: com.github.jitpack:android-example:1.0.4
Show in Project Structure dialog
Affected Modules: app

从命令行运行gradle显示:

代码语言:javascript
复制
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find com.github.jitpack:android-example:1.0.4.
  Searched in the following locations:
      // A LOT OF IRRELEVANT LOCAL LOCATIONS OMITTED
      https://dl.google.com/dl/android/maven2/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.pom
      https://dl.google.com/dl/android/maven2/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.jar
      https://jcenter.bintray.com/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.pom
      https://jcenter.bintray.com/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.jar
      https://repo.maven.apache.org/maven2/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.pom
      https://repo.maven.apache.org/maven2/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.jar
      https://jitpack.io/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.pom
      https://jitpack.io/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.jar
EN

回答 1

Stack Overflow用户

发布于 2019-09-23 13:10:25

如果直接查看https://jitpack.io/#jitpack/android-examplehttps://jitpack.io/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.pom,您会发现:

构建失败。查看jitpack.io上的日志

因此,无法下载该工件。您可以在build.log at https://jitpack.io/com/github/jitpack/android-example/1.0.4/build.log中找到更多的细节。

使用版本1.0.3或2.0继续您的实验。对于您自己的工件,当您查看您自己的build.log时,您会发现问题所在,如果您无法找出出了什么问题,您还可以在https://github.com/jitpack/jitpack.io/issues上打开一个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58062290

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档