【问题标题】:Weird errors after updating to Android Studio 3.1更新到 Android Studio 3.1 后出现奇怪的错误
【发布时间】:2018-03-27 08:36:18
【问题描述】:

所以我看到了 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”时遇到此错误

【问题讨论】:

标签: android android-studio compiler-errors


【解决方案1】:

更新到 3.1 后我遇到了同样的问题。 但这似乎是一个暂时的问题,因为我尝试使用浏览器访问 502 URL 并且可以加载它。 尝试再次同步我的项目后,502 URL 是一个新 URL。 可能更新的人太多,导致加载问题。

编辑:三个小时后,对我来说一切都很好。没有回滚任何东西。临时问题已确认:)

【讨论】:

  • 这可能是原因。这就是为什么它可以与较旧的 gradle 插件一起使用(所有依赖项都在缓存中)并且如果您成功一次就开始工作。
  • 如我所料。一切都恢复正常,无需接触任何东西。
【解决方案2】:

我遇到了同样的问题,构建无法下载随机(每次都不同)依赖项。将 gradle 插件降级到 3.0.1 并且它正在工作,这似乎是他们这边的一个错误。

【讨论】:

    【解决方案3】:

    问题似乎出在您可以在更新时应用的新 gradle 工具 3.1.0 中。

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

    【讨论】:

      【解决方案4】:

      我也遇到了同样的问题,这是暂时的问题,不用担心。您需要做一件事:只需不断重建或清除或清除无效缓存。就是这样。

      【讨论】:

        猜你喜欢
        • 2017-05-21
        • 1970-01-01
        • 1970-01-01
        • 2013-12-31
        • 2016-08-07
        • 1970-01-01
        • 1970-01-01
        • 2018-09-17
        • 2016-03-11
        相关资源
        最近更新 更多