• 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 /
avatar image
2
Question by hybridAli · May 07, 2019 at 09:47 AM · build-error

Gradle build Fails on Unity 2019

I just upgraded my project to Unity 2019.1.1f and downloaded recommended SDK and NDK from Unity Hub.

Gradle used to work fine on my project until I upgraded my project to 2019. Here is what I am getting:


CommandInvokationFailure: Gradle build failed. C:\Program Files\Unity\Hub\Editor\2019.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease" stderr[ FAILURE: Build failed with an exception. Where: Build file 'D:\HH_CASUAL!Repo_Shuriken\Temp\gradleOut\build.gradle' line: 20 What went wrong: A problem occurred evaluating root project 'gradleOut'.

Failed to apply plugin [id 'com.android.application'] Gradle version 2.10 is required. Current version is 4.6. If using the gradle wrapper, try editing the distributionUrl in D:\HH_CASUAL!Repo_Shuriken\Temp\gradleOut\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip


My gradle template under Android folder is already mentioning 2.1.0:


 buildscript {
     repositories {
         jcenter()
     }
 
     dependencies {
         classpath 'com.android.tools.build:gradle:2.1.0'
     }
 }
 
 allprojects {
    repositories {
       flatDir {
         dirs 'libs'
       }
    }
 }
 



Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by AndyKozak · May 07, 2019 at 01:23 PM

With Unity 2019.1 installed Gradle 4.6 by default (via Unity Hub). Remove gradle template if you not using any scecific parameter. Or set 4.6 version in template.

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 hybridAli · May 08, 2019 at 06:37 AM 0
Share

I have already tried this but seems like I don't have 4.6 gradle assets. I am getting this error:

"Could not find com.android.tools.build:gradle:4.6."

I tried removing template and I got 330 errors mostly complaining about android internal e.g

"D8: Type com.google.android.gms.common.internal.zzf is referenced as an interface from com.google.android.gms.common.internal.zzac."

avatar image AndyKozak · May 08, 2019 at 09:11 AM 0
Share

Do you have gradle here c:\Program Files\Unity\Hub\Editor\2019.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\ or in similar location?

avatar image hybridAli AndyKozak · May 08, 2019 at 09:32 AM 0
Share

Yes, I do have $$anonymous$$otlin and other native jars under gradle>lib.

alt text

gradle.png (95.8 kB)
avatar image
0

Answer by pocketman360 · Dec 23, 2019 at 02:08 PM

Sorry for the late response, I had the same problem for a couple of months and I finally got around by installing the The Game Engine Manually from the Archives instead of the Hub and install the Android SDK from Android studios

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 zoyloy10 · Apr 12, 2020 at 10:55 AM

Hi there i have the same problem with unity 2019.3.0f3. Gradle build failed. See the console for details.,Hi there i have the same problem with unity 2019.3.0f3 . Gradle build failed. See console for details.

Comment
Add comment · Show 1 · 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 scelism · Apr 12, 2020 at 08:22 PM 0
Share

Ya lograste resolver el problema? Porque yo tambien tengo el mismo problema.alt text

problem.jpg (64.0 kB)

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

108 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

Related Questions

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

How can I stop the variable values reverting to its default values after being built? 1 Answer

PC Standalone does not run - URGENT 7 Answers

Unity Build Problem with sprite's 1 Answer

build&run error 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