Syntax error in build.gradle when compiling with Buildozer: "Unexpected input: '{'" in dependencies block

I’m trying to compile a KivyMD app using Buildozer to generate the APK for Android. However, when I run buildozer android debug, I get the following error during the gradlew clean assembleDebug phase.

Error message:

FAILURE: Build failed with an exception.

* Where:
Build file '/mnt/d/CDIO/CDIO/Apk/.buildozer/android/platform/build-arm64-v8a/dists/Guard/build.gradle' line: 76

* What went wrong:
Could not compile build file ...
> startup failed:
  Unexpected input: '{' @ line 76, column 14.
  dependencies {
               ^

I haven’t edited the build.gradle file manually, so I suspect this might be caused by a misconfiguration in buildozer.spec or a version conflict with Buildozer or Gradle.

Has anyone faced this issue or knows how to fix it? Any help would be greatly appreciated :folded_hands:

Environment:

  • OS: [Windows / WSL / Linux — please specify]
  • Python 3.x
  • Buildozer version: [add it if known]
  • Kivy + KivyMD installed

If you don’t edit the build script, you are most probably wrong here, but should head to a Buildozer community or maintainer, whatever Buildozer is.

Besides that, you probably would need to provide the build script.
I don’t know why Gradle should complain about a curly brace at that point just from what was shown.
I don’t know any version where this would not be valid as shown.