Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
avatar image
0
Question by afshin_a_1 · Aug 06, 2018 at 08:06 AM · buildbuild-errorandroid buildsdkbuild error

Gradle Build Error

i moved to a new system and now unity won't build an apk using gradle.


unity: 2017.4.8| jdk: 1.8| samethings on both system.| i'm not using any plug-in or 3rd party libraries, just unity itself.


i searched and tryed for example changing value of (#org.gradle.jvmargs=-Xmx2048m) to somethings else(1024-512...) in gradle.properties file in this address (SDK\extras\google\google_play_services\samples\unified\ActivityDemo).


I welcome and appreciate any help :)


the ERROR:

 CommandInvokationFailure: Gradle build failed. 
 C:/Program Files/Java/jdk1.8.0_162\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
 
 stderr[
 
 FAILURE: Build failed with an exception.
 
 * What went wrong:
 Unable to start the daemon process.
 This problem might be caused by incorrect configuration of the daemon.
 For example, an unrecognized jvm option is used.
 Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.0.1/userguide/gradle_daemon.html
 Please read the following process output to find out more:
 -----------------------
 
 
 * Try:
 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
 ]
 stdout[
 Starting a Gradle Daemon (subsequent builds will be faster)
 ]
 exit code: 1
 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
 UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
 UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
 UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
 Rethrow as GradleInvokationException: Gradle build failed
 UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
 UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
 UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


screenshots from my android player settings: alt text alt text

2.jpg (198.5 kB)
1.jpg (194.7 kB)
Comment
Add comment · Show 1
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 Pulkit30 · Aug 06, 2018 at 02:33 PM 0
Share

Did u do that where we go to this pc properties and set environment variables ?

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by afshin_a_1 · Aug 07, 2018 at 11:01 AM

hey guys. after spending hours i figured out the solution. it's about setting the PATH environment variable. what made me crazy was that i could build apk before and suddenly idk it didn't work. here is what i did:


Solution:


1- Select Control Panel and then System. click on "Advanced system settings" from the left side.


2- go to Advanced tab and then "Environment Variables".


3- from the User variables for UserName(mine is Afshin), select "Path" variable and click on Edit.


4- click the New button, copy and paste the JDK directory. mine is this: C:\Program Files\Java\jdk1.8.0_162\bin


5- click ok all the windows.


Extra Solution:


close unity. be sure your internet connection is ok, then turn off your firewall. open unity and hit the build button.


everything should be ok now, you can build for android using gradle.

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 Pulkit30 · Aug 07, 2018 at 01:12 PM 0
Share

hehe was i of help in re$$anonymous$$ding that ?

avatar image awesomeNick · Jan 23 at 09:17 PM 0
Share

It was helpful. Thank you!

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

102 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

Related Questions

Cannot build for Android 2 Answers

[ERROR ][Android Build] [5.3.4] Not able to build 1 Answer

Android APK Build Failing "Execution failed for task ':launcher:checkReleaseDuplicateClasses'." 5 Answers

Unable to install APK to device 0 Answers

UnauthorizedAccessException during Unity Build for Android 2 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