代码之家  ›  专栏  ›  技术社区  ›  AmiNadimi

无法解析“”的依赖项:app@debug/compileClasspath“:无法解析com。安卓支持:多索引:1.0.3

  •  0
  • AmiNadimi  · 技术社区  · 8 年前

    我试图将我的Android Studio 2.2.3更新为版本3,但当我更新时,以下错误阻止了构建过程:

    无法解析“”的依赖项:app@debug/compileClasspath“:无法解析com。安卓支持:multidex:1.0.3。

    无法解析com。安卓支持:multidex:1.0.3。 要求人: 项目:应用程序

    无法解析com。安卓支持:multidex:1.0.3。

    无法分析POM https://dl.google.com/dl/android/maven2/com/android/support/multidex/1.0.3/multidex-1.0.3.pom

    已看到doctype。

    建筑gradle(模块:应用程序):

    buildscript {
        repositories {
            jcenter()
            flatDir {
                dirs 'libs'
            }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.1'
        }
    }
    
    apply plugin: 'com.android.application'
    
    repositories {
        jcenter()
        flatDir {
            dirs 'libs'
        }
        google()
    }
    
    android {
    
        compileSdkVersion 26
        buildToolsVersion '26.0.2'
        useLibrary 'org.apache.http.legacy'
        defaultConfig {
            applicationId "My.App.Id"
            minSdkVersion 17
            targetSdkVersion 26
            versionCode 111
            versionName "1.1.1"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            multiDexEnabled true
        }
    
        dexOptions {
            javaMaxHeapSize "4g"
        }
    
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
            debug {
            }
        }
    }
    
    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.android.support:appcompat-v7:+'
        compile 'com.android.support:design:+'
        compile 'com.android.support:cardview-v7:+'
        compile 'com.android.support:recyclerview-v7:+'
        compile 'com.github.rahatarmanahmed:circularprogressview:+'
        compile files('libs/devicedriverslib.jar')
        compile files('libs/allutils.jar')
        compile 'com.android.support:multidex:1.0.3'
    }
    

    建筑gradle(项目:MyProjectName)

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        repositories {
            jcenter()
            google()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.1'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
        }
    
    }
    

    已安装的生成工具: enter image description here

    gradle包装。属性:

    #Tue Oct 31 12:15:03 IST 2017
    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
    
    2 回复  |  直到 8 年前
        1
  •  1
  •   bmatovu Randy the Dev    7 年前

    我遇到了这个问题,因为我已将全局渐变设置设置为脱机工作

    1. 点击 文件(>);设置 (在macOS上, Android Studio>偏好 )打开 设置 对话
    2. 在左侧窗格中,展开 构建、执行、部署 然后单击 格拉德尔 .
    3. 在“全局渐变设置”下,取消选中 脱机工作 复选框。
    4. 点击 申请 好啊 使您的更改生效。
    5. 重建Gradle

    资料来源: Configure Android Studio

        2
  •  0
  •   AmiNadimi    8 年前

    如果您在防火墙后面,或者即使您在被禁止的国家,您也必须通过VPN工具绕过限制,或者在防火墙中添加正确的例外。(像Psyphon和弱小的东西这样的免费代理将不起作用!你可能想考虑购买一个好的VPN!)

    问题在于正确的internet连接,因此请仔细检查您的网络和internet连接以及任何相关限制。