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
1
Question by Nuaro · Mar 14, 2018 at 05:51 AM · build-errorandroid build

gradle build error when update from 5.6.4p4 to 2017.3.1f1

i got this error when trying to build now on 2017.3.1f1 i have no clue about it, if someone has a problem similar and could help , would be great

 CommandInvokationFailure: Gradle build failed. 
 /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -classpath "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleDebug"
 
 stderr[
 
 FAILURE: Build failed with an exception.
 
 * Where:
 Build file '/Users/hernanzambrano-astete/Workspace/Unity/thomasandfriends-raceon/Temp/gradleOut/build.gradle'
 
 * What went wrong:
 Could not compile build file '/Users/hernanzambrano-astete/Workspace/Unity/thomasandfriends-raceon/Temp/gradleOut/build.gradle'.
 > startup failed:
   General error during class generation: 956
   
   java.lang.ArrayIndexOutOfBoundsException: 956
       at org.codehaus.groovy.classgen.asm.CallSiteWriter.getCreateArraySignature(CallSiteWriter.java:58)
       at org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:317)
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

6 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Ciryus · Apr 12, 2018 at 11:47 AM

Actually in my case it seems to be related to StreamingAssets that are added in the aaptOptions one by one, overstepping the 250 elements limit in the array.

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 Durston88 · Apr 14, 2018 at 06:21 AM 0
Share

I've found the same. Were you able to move beyond this point? As Nuaro mentioned above, I've also found this issue to not occur in Unity 5.6.5.

avatar image Ciryus Durston88 · Apr 23, 2018 at 01:28 PM 0
Share

Unfortunately there is no solution with building in gradle. You could give a try with an internal build, or may be exporting your project with gradle and build it in Android Studio. You could also consider using Asset Bundles ins$$anonymous$$d of Strea$$anonymous$$gAssets.

avatar image Durston88 Ciryus · Apr 23, 2018 at 05:37 PM 0
Share

That is definitely unfortunate. Cannot do an internal build without going beyond the DEX limit. Nor can I make a gradle build in 5.6.5 because even though this problem does not occur, we get another one about duplicate BuildConfig files. It's like 2017.4.1 and 5.6.5 simply traded errors.

How did you come to this conclusion? I unfamiliar with and can't seem to find much info on aaptOptions and how it might interact with Strea$$anonymous$$gAssets. I accept it, just would like to be a bit more in the know :)

avatar image
1

Answer by Artistic · Mar 15, 2018 at 07:48 AM

If it helps someone, when i use "Split Application Binary" (APK + OBB), error is go away..

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 Nuaro · Mar 15, 2018 at 09:08 PM 1
Share

ok the problem is for some reason now Unity add on the build.gradle file all the resources on the aaptOptions, now the problem if you have more than 250 element there, its going to fail because for "reasons" the method org.codehaus.groovy.runtime.ArrayUtil.createArray only create arrays with 250 elements, the way to fix it is split the aaptoption with only 250 elements, that is too the reason when you split the binary works fine.

the thing is I don't know the reason why unity do this, on 5.6 this doesn't occurs.

i hope this help someone, and anyone can give a reason or a way to fix this.

thanks all for the answers

avatar image mwrightmgt Nuaro · May 15, 2018 at 03:30 PM 0
Share

I have run into this same problem when building for Amazon since we cannot use an OBB file. WHat I did to get around this is to use the custom gradle file option in build settings, and then in the aaptOptions section, remove the STREA$$anonymous$$ING_ASSETS text and add in wild card file extensions of all your assets. Why Unity can't do wild card listing like the default ones ins$$anonymous$$d of listing every file is beyond me.

Seems like we could come up with a process script to deter$$anonymous$$e the unique file extensions and then replace the long file listing with just the extensions required. Unfortunately i haven't had time to look into that yet.

avatar image
0

Answer by ikhsaniks · Mar 14, 2018 at 03:51 PM

Hi @Nuaro In Unity version of 2017 or later, only compatible with SDK 25.2.5 and JDK 1.8.161 (I think). So change your SDK -> Tools with 25.2.5 version. If you don't want to overwrite your tools folder you can rename it to something else. Here is my SDK and JDK you can download and add it to the Unity -> Preferences -> External Build https://drive.google.com/drive/folders/16n3hvR9JfTaKWW0MGNDhHLc6XIg3agM9?usp=sharing

hope it works on you. Insya Allah. Regards, Ikhsan Syahputra.

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 Nuaro · Mar 14, 2018 at 05:25 PM

Thanks @ikhsaniks for the help, but i'm still getting the same error, if you have any other idea of what i could try i really appreciate. by the way i'm working on a OSX(Mac)

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 Nuaro · Mar 14, 2018 at 05:57 PM 0
Share

if in something helps, when i remove the resources folder from the unity project , the build is created, and i don't get the error, that makes the issue more weird

avatar image linlinsky · Dec 08, 2018 at 03:02 AM 0
Share

I'm getting the same error. Have you sovled it finally?

avatar image
0

Answer by Durston88 · Dec 10, 2018 at 06:42 PM

@linlinsky Apologies, I never updated this thread. I do believe I figured this out a few weeks after I last posted here. Though it's not fresh in my mind, I do have some brief notes on it, which follow:

To get around the ArrayIndexOutOfBounds issues, I had to go into the custom mainTemplate.gradle file and change STREAMING_ASSETS to manually list out the wild carded filetypes contained in that folder (like “.hd”, “.sd”, “.manifest”)

Looking at the mainTemplate.gradle file in the Unity 5.6.5 project, I don't have a STREAMING_ASSETS flag in it anymore, and it is simply:
 aaptOptions {
             noCompress '.unity3d', '.ress', '.resource', '.obb'
         }

As mentioned I had another issue in 5.6.5 with duplicate BuildConfig files within plugins, and I'd discovered the fix to that at the same time:

To get around the duplicate BuildConfig issues, I manually went into the .jar files for the offending plugins - SwrveSDKPushSupport, SwrveSDKUnityBridge, and Notifications… opened it up as a zip file and simply deleted the BuildConfig file therein. Also had to make sure any created .meta files got deleted before re zipping back into a .jar file.

Hope this is helpful!

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
  • ›

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

138 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

Related Questions

Builds Apk Error/ Unity 2019.3.15 0 Answers

The attribute meta-datattcom.google.android.gms.ads.APPLICATION JD@value=********** in :GoogleMobileAdsPlugin.androidlib collides with another value (See the Console for details) 0 Answers

Getting Android build errors. 1 Answer

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

Unity Gradle Build Error - Resource Not Found 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