android - Gradle 同步失败 : Expected BEGIN_ARRAY but was STRING at line 1 column 1 p

标签 android android-studio android-gradle-plugin

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

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

"Expected BEGIN_ARRAY but was STRING at line 1 column 1 p".

关键是我从未更改过我的 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 - Gradle 同步失败 : Expected BEGIN_ARRAY but was STRING at line 1 column 1 p,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45340501/

相关文章:

android - 多个 Android 项目具有通用库项目?

Android 对端未通过身份验证

java - 将实时数据从 Viewpager Fragment 共享到 Activity

Android在gradle中添加库

java - Android Studio getApplicationContext()

android - 在一个地方更改 ID 会更改 Android XML 文件中其他位置的 ID

android - Gradle:多个dex文件定义LR

java - fragment 已添加,尽管它只添加了一次

android - 在发送到服务器之前调整图像大小

android - 如何修复 getActionBar 方法可能会产生 java.lang.NullPointerException