KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.36k stars 650 forks source link

Fails to build for Android with `A problem was found with the configuration of task ':app:mergeDebugJniLibFolders'` #1178

Open nrawrx3 opened 1 month ago

nrawrx3 commented 1 month ago

I am trying to build for Android and I get this same error when building from both a macbook and windows desktop.

Android Studio version:

Android Studio Koala Feature Drop | 2024.1.2
Build #AI-241.18034.62.2412.12266719, built on August 23, 2024
Runtime version: 17.0.11+0--11852314 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 16
Registry:
  ide.experimental.ui=true
Non-Bundled Plugins:
  Dart (241.18808)
  com.developerphil.adbidea (1.6.17)
  io.flutter (81.0.2)

Error:

* What went wrong:
A problem was found with the configuration of task ':app:mergeDebugJniLibFolders' (type 'MergeSourceSetFolders').
  - Gradle detected a problem with the following location: 'C:\Users\Soumik\werk\Vulkan-Samples\build\android_gradle\layerLib\jniLibs\android-binaries-1.3.275.0'.

    Reason: Task ':app:mergeDebugJniLibFolders' uses this output of task ':app:unzip' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

    Possible solutions:
      1. Declare task ':app:unzip' as an input of ':app:mergeDebugJniLibFolders'.
      2. Declare an explicit dependency on ':app:unzip' from ':app:mergeDebugJniLibFolders' using Task#dependsOn.
      3. Declare an explicit dependency on ':app:unzip' from ':app:mergeDebugJniLibFolders' using Task#mustRunAfter.

    For more information, please refer to https://docs.gradle.org/8.7/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

I have tried to add that as a dependency using dependsOn, but then it just says no such task "mergeDebugJniLibFolders" was defined in app.

SaschaWillems commented 1 month ago

Thanks for bringing this up. We currently don't support the latest Android Studio version and gradle build tools (see https://github.com/KhronosGroup/Vulkan-Samples/blob/main/docs/build.adoc#android). We'll soon update the samples to work with recent tools.