【问题标题】:Can't build project, Gradle output tells Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $无法构建项目,Gradle 输出告诉 Use JsonReader.setLenient(true) 在第 1 行第 1 列路径 $ 接受格式错误的 JSON
【发布时间】:2018-08-24 13:37:58
【问题描述】:

我刚刚打开了我的项目,但无法构建它。 这是我的 Gradle 控制台输出:

18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:mergeDebugResources'.
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Error: java.lang.RuntimeException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
18:12:07.274 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 4s

昨天我工作的时候一切都很好。我该怎么办? 提前致谢!

【问题讨论】:

  • 在你的电脑和clean开始互联网连接,然后Rebuild这个项目,我有同样的,它会像这样工作
  • 我刚刚将整个项目复制到一个新项目中,它解决了问题。无论如何,谢谢!

标签: android build


【解决方案1】:

什么 JSON 文件给出了错误?该文件可能已损坏。

如果是Firebase或者Crashlytics或者其他库提供的JSON文件,清理项目后可以重新下载替换文件..

【讨论】:

    猜你喜欢
    • 2017-06-03
    • 2017-02-16
    • 2018-08-25
    • 1970-01-01
    • 1970-01-01
    • 2018-06-24
    • 1970-01-01
    • 2018-05-17
    • 2020-02-08
    相关资源
    最近更新 更多