1

I've just opened my project and I couldn't build it. Here is my Gradle console output:

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

Everything worked well when I worked on it yesterda. What should I do? Thanks in advance!

  • start internet connection on your pc and `clean` and then `Rebuild` the project, I have the same one it ll work like this – Nikunj Paradva Mar 15 '18 at 16:31
  • I just copied my whole project into a new one and it solved the problem. Thanks anyways! – alonstarikov4 May 10 '18 at 18:16
  • For anyone else who has run into this problem, this answer has the solution: https://stackoverflow.com/a/70621318/185034 – Paul Feb 03 '23 at 14:14

2 Answers2

0

What JSON file is giving the error? The file might have been corrupted.

If it is the JSON file provided by Firebase or Crashlytics or some other library, you can re-download and replace the file after cleaning your project..

Adib Faramarzi
  • 3,798
  • 3
  • 29
  • 44
-1

In all seriousness, use Maven - Gradle is not backwards compatible with itself. Gradle developers do not understand that they have a contract with developers and vX is always breaking vX-1 or, if you must use Gradle, then use v5.6.4

B Rife
  • 9
  • 3