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

应为BEGIN_ARRAY,但在生成APK时,BEGIN_OBJECT位于第1行第2列路径$

邵飞白
2023-03-14
FAILURE: Build failed with an exception.

* What went wrong:
java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
> Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more 
log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

那么我如何找到错误的来源呢

共有1个答案

郗河
2023-03-14

我在Android Studio4.0中做分级同步时遇到了这个问题。我通过以下操作修复了它:

>

  • 打开顶级build.gradle并将gradle类路径更改为:

    classpath 'com.android.tools.build:gradle:4.0.0'
    

    打开gradle\wrapper\gradle-wrapper.properties并将分发URL更改为:

    distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
    

  •  类似资料: