更新至Android Studio 3.1后出现奇怪的错误

6

我看到了Android Studio的新更新并进行了更新。

尽管我不断遇到更多与服务器问题相关而不是与我的应用程序相关的错误。但这与我的应用程序无关。

我的一个应用程序出现了这个错误Could not HEAD 'https://jcenter.bintray.com/com/sun/xml/bind/mvn/jaxb-parent/2.2.11/jaxb-parent-2.2.11.pom'. Received status code 504 from server: Gateway Time-out Enable Gradle 'offline mode' and sync project

我尝试了离线部分,但它没有起作用。

另一个应用程序有这个问题

    Could not HEAD 'https://jcenter.bintray.com/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar'. Received status code 504 from server: Gateway Time-out
Enable Gradle 'offline mode' and sync project

我很感激你的帮助,因为我是最后一个需要帮助的人。

//////////

编辑 显然这是gradle的问题,尽管它在这里出现了。

    apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    buildToolsVersion '27.0.3'
    defaultConfig {
        multiDexEnabled true
        applicationId "com.reecreate.woderator2"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      //  resConfigs "auto"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.android.support:multidex:1.0.1'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.google.firebase:firebase-firestore:11.8.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.android.gms:play-services-auth:11.8.0'
    implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
    implementation 'com.facebook.android:facebook-login:4.27.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.27.0'
    implementation 'com.google.android.gms:play-services-auth:11.8.0'
    implementation 'com.github.charbgr:authmanager:1.0'
    implementation 'com.github.warkiz.widget:indicatorseekbar:1.2.9'


    testImplementation 'junit:junit:4.12'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

apply plugin: 'com.google.gms.google-services'

虽然现在我运行我的应用程序时(或尝试运行)出现此错误:“09:54 Error running 'app': Unknown error”。


是的...你试过重启吗(AS)? 这对我有帮助。 - Selvin
刚刚更新了,但问题完全相同。 - AAverin
我在3.1更新后也遇到了同样的问题。 - Manthan Patel
一些额外的消息:OutOfMemoryError: Java堆空间或GC超时限制。仅在新的Android Studio 3.1上发生。JavaMaxHealSize已设置为4g。只是先不要更新。 - AAverin
显示剩余5条评论
4个回答

2

我在升级到3.1版本后遇到了同样的问题。 但是似乎这只是一个暂时性的问题,因为我用浏览器尝试访问502 URL,它可以加载。 再次尝试同步我的项目后,502 URL变成了新的URL。 可能有太多人正在更新,导致负载问题。

编辑:三个小时后,对我来说一切都好了。没有回滚任何内容。确认是暂时性问题 :)


这很可能是原因。这就是为什么它可以使用旧的gradle插件(所有依赖项都在缓存中),并且如果您成功一次,它将开始工作。 - diidu
正如我所猜测的那样。一切都正常工作了,而没有触碰任何东西。 - Stanislas Dourdin

0

我遇到了同样的问题,构建失败无法下载随机(每次都不同)的依赖项。将Gradle插件降级到3.0.1并且它正常工作,看起来是他们那边的一个bug。


0

问题似乎出在新的Gradle工具3.1.0上,当你更新时可以应用它。

在你的build.gradle中将其回滚到classpath 'com.android.tools.build:gradle:3.0.1'


0

我也遇到过同样的问题,这是一个临时性问题,不需要担心。你只需要做一件事:持续地重新构建、清除或使缓存失效即可。就这样。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接