未能解析:customview-1.1.0



我是android的新手,在编译时我得到了这个错误,这有点奇怪,因为直到不久前我还没有得到它,我还没有在我记忆中的项目中做出任何重要的更改,我试图同步gradle,但它给了我404错误,我试图找到这个依赖项在哪里,因为我没有放任何,所以我不知道,我很困惑,我认为这将是一个很容易解决的问题,但我找不到解决方案,我对404错误无能为力,我正在使用Avira VPN和Turbo VPN进行连接,因为没有VPN,在我的国家是不可能的,多亏了他们,我可以在安卓中开发,如果有人能告诉我是否必须在渐变文件中添加一些内容或删除一些内容,我将不胜感激,我对此感到非常紧张,有时android工作室的错误会让我不知所措。这就是我同步时显示的全部内容:

Failed to resolve: customview-1.1.0
Affected Modules: app

这显示了我尝试编译时:注意:这是给我错误的url:

1:任务失败,出现异常。

  • 出了什么问题:任务":app:compileDebugKotlin"的执行失败。未能解析配置":app:debugCompileClasspath"的所有文件。找不到customview-1.1.0.jar(androidx.customview:customview:1.1.0)。在以下位置搜索:https://dl.google.com/dl/android/maven2/androidx/customview/customview/1.1.0/customview-1.1.0.jar

渐变应用

plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdkVersion 30
buildToolsVersion '30.0.2'

defaultConfig {
applicationId "com.example.navigationrecicler"
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
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
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
def work_version = "2.6.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.drawerlayout:drawerlayout:1.1.1'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation "androidx.work:work-runtime-ktx:$work_version"
implementation "com.anggrayudi:storage:0.12.0"
implementation 'com.github.skydoves:progressview:1.1.2'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
implementation 'com.yarolegovich:discrete-scrollview:1.5.1'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.github.CanHub:Android-Image-Cropper:3.3.5'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

渐变项目

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.10"
repositories {
google()
mavenCentral()
maven { url "https://www.jitpack.io" }
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://www.jitpack.io" }
jcenter() // Warning: this repository is going to shut down soon
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

如果你的问题是连接,那么下面是如何解决这个

使用您的代理或psiphon,您可以在您的设置中设置本地代理端口,例如30001

然后可以转到%USERNAME%/.gradle/gradle.properties,如果该文件不存在,则创建一个。

然后您可以将其添加到grade.properties

systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=30001

systemProp.https.proxyHost=8.36.224.208
systemProp.https.proxyPort=30001

这将确保gradle使用的所有连接都将通过已打开的代理。

在检查了依赖项之后,您就没有这个依赖项了

runtimeOnly 'androidx.customview:customview:1.1.0'