gpt4 book ai didi

android - Jitpack:无法通过示例库解决(Android Studio)

转载 作者:行者123 更新时间:2023-12-03 04:13:24 31 4
gpt4 key购买 nike

我无法使用jitpack导入任何库。我的问题是我自己的库,但是下面的com.github.jitpack:android-example:1.0.4用作jitpack本身提供的示例库,应该可以立即使用。另请注意,Android Studio中已关闭离线内容。

根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 Studio显示:
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,您会发现:

Build failed. See the log at jitpack.io



因此,该项目无法下载。您可以在build.log的 https://jitpack.io/com/github/jitpack/android-example/1.0.4/build.log上找到更多详细信息。

使用1.0.3或2.0版继续进行实验。对于您自己的 Artifact ,当您查看自己的build.log时会发现问题,如果您无法找出问题所在,也可以在 https://github.com/jitpack/jitpack.io/issues上打开问题。

关于android - Jitpack:无法通过示例库解决(Android Studio),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58062290/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com