Search Unity

Gradle build failed unity 2019.1.0f2 Personal

Discussion in 'Android' started by Ballistic_Games_dev, Jul 21, 2019.

  1. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    Please how do i solve this problem:
    CommandInvokationFailure: Gradle build failed.
    C:\Program Files\Unity\Hub\Editor\2019.1.0f2\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.1.0f2\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
     
  2. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    Share the complete error to look into it.
     
  3. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    Here it is..
     

    Attached Files:

  4. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    ok few more questions.

    Do you have any files like mainTemplate.gradle in Assets/Plugins/Android folder? If so share it. Else share Temp/gradleOut/build.gradle file (Make sure you remove any sensitive info with in this file and pass it)
     
  5. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    Yes. mainTemplate.gradle.DISABLED
     

    Attached Files:

  6. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    try this once.
    Make sure you enable it so that .DISABLED is removed. Let me know how it goes.
     

    Attached Files:

  7. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    How do i enable it?
     
  8. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    Check in Player Settings -> Publishing Settings for Android -> Custom Gradle Template
     
  9. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    Still getting the same errors.
    do i need to make any changes to the meta file?
     

    Attached Files:

  10. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    So i happened to switch on my internet connection and during build , it seems to have used up 70mb for some reason i don't know . but i still got build error .100 errors compared to the 248 i was having before.
     

    Attached Files:

  11. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    You won't have .txt at the end once you enable it. Did you add it?
     
  12. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    It will try to download some missing files. From the log it looks more like a network connection problem. Recheck once.
     
    Ballistic_Games_dev likes this.
  13. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    Of course there's no .txt after the file name. I didn't change the actual file, all i did was to edit it by deleting the old text in it and pasting the new one you gave me. It's enabled also. I'll try building again.
     
  14. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    Tried again. reduced to 19 errors.
     

    Attached Files:

  15. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    Did a second run and got 42 errors.
     

    Attached Files:

  16. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    This is where build failed.
     

    Attached Files:

  17. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    Hi,
    Still it shows the error as a part of network download issue. Can you give a try on a different network once?

    Or try from a new version of Unity.
     
  18. Ballistic_Games_dev

    Ballistic_Games_dev

    Joined:
    Feb 5, 2019
    Posts:
    21
    Thanks a lot . Had to close and restart unity for proper network connection. build successful with no error.
     
  19. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968