1

Hello Stack Overflow community,

I have a problem I hope you can help me with.

When opening a project I made with Unity and then build for Android, I keep getting this error message "Gradle sync failed: Cause: org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection Consult IDE log for more details (Help | Show Log)".

Build Setting Unity: https://i.stack.imgur.com/WLkTa.png

Error message Android Studio: https://i.stack.imgur.com/JX37g.png

I've already tried a number of thing:

  • Both options Android Studio gives me:
    1. Re-download dependencies and sync project.
    2. Stop Gradle Build process.
  • Deleting the folder "gradle" from my project and retrying.
  • Changing the "gradle-wrapper.properties" file:
    1. Changing "gradle-3.3-all.zip" to "gradle-3.4.1-all.zip".
    2. Adding this line: "org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m".

I'm still getting the same problem and I'm hoping someone here can help me with it.

Thanks in advance,

Frenk

IAmFrenk
  • 43
  • 7

1 Answers1

0

This is the solution I found to exactly this problem:

Gradle Sync Failed - Android Studio 2.3.1

I set the Android plugin version for Gradle to 2.3.3 in the

File > Project Structure > Project : "Android Plugin Version"

sirandy
  • 1,834
  • 5
  • 27
  • 32