当前位置: 首页 > 知识库问答 >
问题:

org.gradle.api.projectConfigurationException:更新到AndroidStudio-3.5.3后配置根项目时出现问题

锺离韬
2023-03-14
  org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'Gsa2_NewMenu'.
Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom'.
    at org.gradle.internal.resource.ResourceExceptions.failure(ResourceExceptions.java:74)
    at org.gradle.internal.resource.ResourceExceptions.getFailed(ResourceExceptions.java:57)
    at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.copyToCache(DefaultCacheAwareExternalResourceAccessor.java:201)
    at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.access$300(DefaultCacheAwareExternalResourceAccessor.java:55)
    at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor$1.create(DefaultCacheAwareExternalResourceAccessor.java:90)
    at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor$1.create(DefaultCacheAwareExternalResourceAccessor.java:82)
    at org.gradle.cache.internal.ProducerGuard$AdaptiveProducerGuard.guardByKey(ProducerGuard.java:97)
    at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.getResource(DefaultCacheAwareExternalResourceAccessor.java:82)
    at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.downloadByCoords(DefaultExternalResourceArtifactResolver.java:138)
    at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.downloadStaticResource(DefaultExternalResourceArtifactResolver.java:98)
    at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.resolveArtifact(DefaultExternalResourceArtifactResolver.java:65)
    at org.gradle.api.internal.artifacts.repositories.metadata.AbstractRepositoryMetadataSource.parseMetaDataFromArtifact(AbstractRepositoryMetadataSource.java:69)
    at org.gradle.api.internal.artifacts.repositories.metadata.AbstractRepositoryMetadataSource.create(AbstractRepositoryMetadataSource.java:59)
    at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.resolveStaticDependency(ExternalResourceResolver.java:199)
    at org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver.doResolveComponentMetaData(MavenResolver.java:117)
    at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.resolveComponentMetaData(ExternalResourceResolver.java:400)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$ResolveAndCacheRepositoryAccess.resolveComponentMetaData(CachingModuleComponentRepository.java:381)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.resolveComponentMetaData(ErrorHandlingModuleComponentRepository.java:136)
    ... 133 more
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom'.
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:96)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRawGet(HttpClientHelper.java:80)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performGet(HttpClientHelper.java:84)
    at org.gradle.internal.resource.transport.http.HttpResourceAccessor.openResource(HttpResourceAccessor.java:43)
    at org.gradle.internal.resource.transport.http.HttpResourceAccessor.openResource(HttpResourceAccessor.java:29)
    at org.gradle.internal.resource.transfer.DefaultExternalResourceConnector.openResource(DefaultExternalResourceConnector.java:56)
    at org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceAccessor.openResource(ProgressLoggingExternalResourceAccessor.java:36)
    at org.gradle.internal.resource.transfer.AccessorBackedExternalResource.withContentIfPresent(AccessorBackedExternalResource.java:130)
    at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$11.call(BuildOperationFiringExternalResourceDecorator.java:237)
    at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$11.call(BuildOperationFiringExternalResourceDecorator.java:229)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:350)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:340)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:120)
    at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator.withContentIfPresent(BuildOperationFiringExternalResourceDecorator.java:229)
    at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.copyToCache(DefaultCacheAwareExternalResourceAccessor.java:199)
    ... 148 more
Caused by: java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "XX.XX.XXX"
        minSdkVersion 22
        targetSdkVersion 26
        versionCode 13
        versionName "6.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories{
    maven { url "jitpack.io" }
    maven { name 'glide-snapshot'; url 'oss.sonatype.org/content/repositories/snapshots' }
    mavenCentral()
}

dependencies {
    /*implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })*/
    implementation files('libs/apache-httpcomponents-httpclient.jar')
    implementation files('libs/apache-httpcomponents-httpcore.jar')

    implementation files('libs/commons-codec-1.11.jar')
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
    implementation 'com.android.support:cardview-v7:27.1.0'
    implementation 'com.google.android.gms:play-services-location:11.0.4'
    implementation 'com.google.firebase:firebase-messaging:11.0.4'
    implementation 'com.jakewharton.timber:timber:4.5.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    implementation 'com.android.support:support-v4:27.1.0'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'me.dm7.barcodescanner:zxing:1.8.4'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    implementation 'com.google.code.gson:gson:2.6.2'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.github.antonKozyriatskyi:CircularProgressIndicator:1.3.0'

    implementation 'com.google.code.gson:gson:2.6.2'
    implementation 'com.squareup.retrofit2:retrofit:2.0.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
    implementation 'com.android.support:recyclerview-v7:27.1.0'


    implementation(name:'merchantsdk', ext:'aar')
    implementation(name:'ezetapandroidsdk', ext:'aar')

    testImplementation 'junit:junit:4.12'
    implementation files('libs/org.apache.commons.io.jar')
}


apply plugin: 'com.google.gms.google-services'
buildscript {
    repositories {

        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://jitpack.io'
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }

        flatDir {
            dirs 'libs'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

共有1个答案

刁茂才
2023-03-14

您能尝试从以下位置更改顺序吗:

发件人:

buildscript {
    repositories {

        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }

致:

buildscript {
        repositories {
                google()
                jcenter()
           maven {
                url 'https://maven.google.com/'
                name 'Google'
            }
        mavenCentral()


        }
 类似资料:
  • 我不理解收到的错误消息,也不知道如何解决它。当我尝试构建项目时,我看到以下错误: 我正在使用带有Ionic框架的Cordova。

  • > 出了什么问题:配置项目“:反应原生矢量图标”时出现问题。 无法解析配置“:反应本机矢量图标:类路径”的所有文件。找不到 com.android.tools.build:gradle:2.3 的任何匹配项。 因为没有可用的com.android.tools.build:gradle版本。在以下位置搜索: https://jcenter.bintray.com/com/android/tools/

  • 我在react-native中构建了一个项目,它在我的计算机上运行良好,但在更改其位置后,问题开始出现。我使用“yarn add@react-native-community/async-storage”安装了这个包

  • 当我在手机上运行应用程序时,我得到了这个错误,即使在重新安装应用程序后,它仍然给我这个错误: 我正在使用电话套餐通过flutter app发送短信: 我使用联系人选择器,然后将号码发送到aove函数:

  • 我运行的是Mac OSX,我安装了android Studio-它启动正常。 问题1 我用一个空活动开始一个新项目。在最上面的窗户上我收到一条信息 问题2 我在底部窗口中看到以下错误: 错误:CompilesDKVersion android-L需要使用JDK 7 Open SDK Settings进行编译 打开文件 当我尝试在设备上运行项目时,我得到以下错误: 失败[INSTALL_FAILED

  • 我正在尝试更新现有的cordova应用程序(android@5.2.2)至android@7.0.0由于谷歌新政策允许开发者使用play store。 该项目是用cordova(没有ionic)构建的,并且有一些用Android Studio(.java)创建的文件夹。我几乎不了解移动开发,但我必须在不改变太多代码的情况下处理这个需求(因为它只是一个版本升级)。 当我运行时没有错误,但我在尝试时得