【问题标题】:Gradle sync failed: Expected BEGIN_ARRAY but was STRING at line 1 column 1 pGradle 同步失败:预期为 BEGIN_ARRAY,但在第 1 行第 1 列为 STRING
【发布时间】:2017-07-27 02:48:34
【问题描述】:

在使用 Android Studio 3.0 (canay7) 时,我的电脑崩溃了。我重新启动了 Windows 和 Android Studio。

我的项目 Gradle 同步失败,现在显示消息:

“应为 BEGIN_ARRAY,但在第 1 行第 1 列 p 为 STRING”。

关键是我从未更改过我的 Gradle 文件。

我已经使缓存失效并重新启动了 Android Studio,但它没有工作。 我不知道是什么导致了这个问题。谁能帮帮我?

这是我的 Gradle 文件:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha7'
//        classpath 'com.android.tools.build:gradle:2.3.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

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

【问题讨论】:

  • 这听起来像一个错误。提交报告!
  • 我自己也刚遇到这个错误。这是一个错误还是我可以使用的解决方法?
  • 你解决问题了吗?

标签: android android-studio android-gradle-plugin


【解决方案1】:

尝试清理构建项目。它对我有用

快乐编码

【讨论】:

    【解决方案2】:

    只需清理应用程序 第 1 步转到构建 第 2 步清理项目

    完美运行

    【讨论】:

    • 删除这个重复的答案
    猜你喜欢
    • 1970-01-01
    • 2017-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-13
    • 2020-06-21
    • 1970-01-01
    相关资源
    最近更新 更多