Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
2
Question by mechangel · Oct 12, 2017 at 12:24 AM · android buildandroid sdk

How to fix Android Gradle Failure?

Unity Version: 2017.30b4 (although I have also tried the latest release build) macOS Sierra 10.2.6 android studio 2.3.3 latest NDK installed latest Java installed

I have tried to fix this issue by following this process (but for Mac):

Go to your Android SDK Folder. (If you did not change the path during Android Studio installation you will find the SDK folder here: C:\Users\YourUsername\AppData\Local\Android\sdk )

Rename the old Android sdk "Tool" folder : [Your Android SDK root]/tools -> toolsXXXX

Download Android SDK Tools, Revision 25.2.5 (January 2017): http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip

This fix got me further in the build process, but I'm still getting a failure:

CommandInvokationFailure: Gradle build failed. /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/java -Xmx1024M -classpath "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "--no-daemon" "assembleDebug"

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mechangel · Oct 17, 2017 at 04:31 PM 0
Share

I am still having this issue after trying to build with Unity 2007.2.0f3.

avatar image ahmedaniss · Apr 15, 2021 at 05:12 PM 0
Share

problem fixed here : https://youtu.be/Zra0OLujEfs

15 Replies

· Add your reply
  • Sort: 
avatar image
10

Answer by sadsa · Mar 29, 2018 at 10:59 AM

Changed from Gradle to Internal on build settings and it workedalt text


unity-build.jpg (46.8 kB)
Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MAWMatt · Jun 02, 2018 at 03:33 PM 4
Share

The question was how to fix the Gradle error, not how to not use Gradle. :P

avatar image afshin_a_1 · Mar 22, 2019 at 01:56 AM 0
Share

this is not the correct answer!

avatar image sunxia · Apr 10, 2019 at 09:24 AM 0
Share

Swithing to Internal give me another error 'Failed to build apk. See Console for details.'. Then after downgrading jdk 12 to jdk 8 it worked for me. But simply downgrading jdk still results in the same error.

avatar image tmendez · Apr 22, 2019 at 11:47 PM 0
Share

Internal build system is now deprecated

avatar image saliakbari6603 · May 15, 2019 at 10:18 AM 0
Share

force build gradle no internal build

Show more comments
avatar image
8

Answer by Alstev · Mar 20, 2018 at 04:37 PM

Hello!

Downgrading to Java jdk 8 (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) was part of the answer for me.

It only worked after I ALSO went to Android Studio-->Settings -->SDK tools --> uninstall the update 28-rc1

(I had to do this because I had previously installed the r25.2.5 version of SDK manually by replacing the tools, but the 28-rc1 version will not be compatible with the downgraded Java jdk, causing yet another problem)

This are the two answers I combined in order to solve my problems:

  1. https://answers.unity.com/questions/1323731/unable-to-list-target-platforms-please-make-sure-t.html

  2. https://answers.unity.com/questions/1478218/build-error-unity201731f1.html

Hope This helped :)

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tau943 · Mar 26, 2018 at 07:20 PM 0
Share

Yes! Thanks so much, uninstalling 28-rc was my missing step!

avatar image Staus · Apr 06, 2018 at 01:33 PM 0
Share

Thanks! I had the right JD$$anonymous$$, but your comment on downgrading the SD$$anonymous$$ helped me. The Oculus documentation mentioned Android SD$$anonymous$$ Build Tools, v 26.0.2 and that worked for me

avatar image EMPHeckler · Apr 10, 2018 at 10:16 PM 0
Share

Thank you! $$anonymous$$y Sunday and $$anonymous$$onday night gone... but you have made my Tuesday! I found by downgrading to Java 8 was able to fix the issue per your assist!

avatar image
5

Answer by DistantLifeform · Mar 04, 2018 at 03:52 AM

use jdk 8 instead of 9 and it will build successfully, just tested and it works.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image gamingAndLearning · Mar 09, 2018 at 01:42 AM 0
Share

yes - thank you it worked perfected when i installed jdk 8 ins$$anonymous$$d of 9

avatar image OWL7seven · Apr 10, 2018 at 02:51 PM 0
Share

i had jdk 10 and removing it and having 8 installed helped. didnt need to touch Andriod SD$$anonymous$$

avatar image
1

Answer by ddyer9 · Mar 07, 2018 at 08:16 PM

This problem took me two days to figure out after reinstalling Android SDK, updating all my files, following Google quick-start guide to the best of my ability. Replacing the tools folder with the older version did fix the SDK path issue but then I was getting this same Gradle issue.

As someone mentioned above what fixed this for me was replacing the JDK. Java SE Development Kit 8u161 is the version that worked for me. All I can say is.... hallelujah!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by mechangel · Oct 18, 2017 at 12:06 AM

Fixed by following these directions to swap out the Tools folder. http://answers.unity3d.com/questions/1320634/unable-to-list-target-platforms-when-i-try-to-buil.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • 3
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

141 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity 2017.2.0b9 ARCore build&run with Pixel XL (Android 8.0) Failed 0 Answers

Package Appears to be Corrupt error on Android,Package appears to be corrupt on android?? 0 Answers

Devices No Longer Supported | When releasing app on google playstore 0 Answers

WINDOWS 10 DllNotFoundException: sqlite3 0 Answers

I cant build my game for Android. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges