簡體   English   中英

Jitpack:無法使用示例庫(Android Studio)解決

[英]Jitpack: Failed to resolve with Example Library (Android Studio)

我無法使用 jitpack 導入任何庫。 我的問題出在我自己的庫上,但在com.github.jitpack:android-example:1.0.4下方用作 jitpack 本身提供的示例庫,應該可以開箱即用。 另請注意,android 工作室中的離線內容已關閉。

根 build.gradle

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
}

應用程序 build.gradle

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

錯誤信息

Android工作室展示:

ERROR: Failed to resolve: com.github.jitpack:android-example:1.0.4
Show in Project Structure dialog
Affected Modules: app

從命令行運行 gradle 顯示:

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

如果您查看https://jitpack.io/#jitpack/android-examplehttps://jitpack.io/com/github/jitpack/android-example/1.0.4/android-example-1.0.4 .pom直接,你會發現:

構建失敗。 查看 jitpack.io 的日志

因此,該工件不可下載。 您可以在https://jitpack.io/com/github/jitpack/android-example/1.0.4/build.logbuild.log中找到更多詳細信息。

使用 1.0.3 或 2.0 版本繼續您的實驗。 對於您自己的工件,當您查看自己的build.log時會發現問題,如果您無法找出問題所在,您也可以在https://github.com/jitpack/jitpack.io/上打開一個問題問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM