我不能使用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
}App 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'
}
}错误信息
安卓工作室展示:
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发布于 2019-09-23 13:10:25
如果直接查看https://jitpack.io/#jitpack/android-example或https://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上打开一个问题。
https://stackoverflow.com/questions/58062290
复制相似问题