【问题标题】:Failed to resolve: customview-1.1.0无法解决:customview-1.1.0
【发布时间】:2021-12-07 07:40:38
【问题描述】:

我是android新手,编译的时候出现这个错误,有点奇怪,因为直到不久前我还没有得到它,并且我记得我在项目中没有做任何重要的改变,而且我试图同步gradle,但它给了我404错误,我试图找到这个依赖在哪里,因为我没有放任何,所以我不知道,我很困惑,我以为它会是一个很容易解决的问题,但我找不到解决方案,我对 404 错误无能为力,我正在使用 Avira VPN 和 Turbo VPN 进行连接,因为没有 vpn 在我的国家是不可能的,感谢他们我可以在 android 中开发,如果有人可以告诉我是否必须在 gradle 文件中添加某些内容或删除某些内容,我将不胜感激,我对此感到非常压力,android studio 错误有时会克服我同步:

Failed to resolve: customview-1.1.0
Affected Modules: app

当我尝试编译时,这显示了我: 注意:这是给我错误的网址:

1:任务因异常而失败。

分级应用

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

gradle 项目

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

【问题讨论】:

    标签: android android-studio gradle dependencies


    【解决方案1】:

    如果您的问题与连接有关,那么这里是解决方法

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

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

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

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

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

    检查依赖关系后,你没有this dependency

    runtimeOnly 'androidx.customview:customview:1.1.0' 
    

    【讨论】:

    • 感谢@George 但不起作用,它偷了我 404 错误
    • 你的 gradle 版本是什么?
    • 我的 gradle 版本是 6.7.1
    • 4以上就好了,那我还是认为是连接问题,进入build.gradle目录,打开cmd输入gradle properties,这会列出所有的属性,你可以确定如果你代理配置是否正确。
    • 我会尝试,需要注意的是,在浏览器中我尝试打开该 url,它也给了我一个 404 错误
    猜你喜欢
    • 2019-05-11
    • 1970-01-01
    • 1970-01-01
    • 2018-07-17
    • 2020-01-17
    • 2018-09-25
    • 2018-02-08
    • 1970-01-01
    • 2020-01-31
    相关资源
    最近更新 更多