如何修复 401 问题,我尝试实现 autoimageSlider 并成功完成,但是当我用最新版本升级我的 android studio 版本时,我得到了这种错误。我也尝试从 gradle 切换到离线模式,但对我没有任何作用请帮助我
build.gradle(项目:)
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.google.gms:google-services:4.3.8'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://www.jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Could not HEAD
builde.gradle(模块)
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "com.example.mycollege"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.facebook.android:facebook-android-sdk:11.0.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.github.smarteist:autoimageslider:1.4.0'
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
implementation 'org.jetbrains:annotations:21.0.1'
implementation 'de.hdodenhof:circleimageview:3.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
错误
'https://www.jitpack.io/com/github/smarteist/autoimageslider/1.4.0/autoimageslider-1.4.0.pom'. Received status code 401 from server: Unauthorized
Disable Gradle 'offline mode' and sync project