• 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
5
Question by Olamire · Aug 22, 2017 at 07:59 AM · build-error

Gradle build errors

i moved to a new system and now unity won't build an apk using gradle. i try to change remove the debug value in the android manifest but every time i build the manifest defaults to it. it gives me this error:

CommandInvokationFailure: Gradle build failed. C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-2.14.jar" org.gradle.launcher.GradleMain "assembleRelease"

stderr[ C:\Users\Olamire\Last Stand\Last Stand\Temp\gradleOut\src\main\AndroidManifest.xml:4: Error: Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one [HardcodedDebugMode]

                                                                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~

Explanation for issues of type "HardcodedDebugMode": It's best to leave out the android:debuggable attribute from the manifest. If you do, then the tools will automatically insert android:debuggable=true when building an APK to debug on an emulator or device. And when you perform a release build, such as Exporting APK, it will automatically set it to false.

If on the other hand you specify a specific value in the manifest file, then the tools will always use it. This can lead to accidentally publishing your app with debug information.

1 errors, 0 warnings Note: there were 11 duplicate class definitions. (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass) Warning: com.unity.purchasing.googleplay.GooglePlayPurchasing$6: can't find referenced class com.google.vr.ndk.base.DaydreamApi Warning: com.unity.purchasing.googleplay.GooglePlayPurchasing$6: can't find referenced class com.google.vr.ndk.base.DaydreamApi Warning: com.unity.purchasing.googleplay.GooglePlayPurchasing$6: can't find referenced class com.google.vr.ndk.base.DaydreamApi Warning: com.unity.purchasing.googleplay.GooglePlayPurchasing$6: can't find referenced class com.google.vr.ndk.base.DaydreamApi Warning: com.unity.purchasing.googleplay.GooglePlayPurchasing$6: can't find referenced class com.google.vr.ndk.base.DaydreamApi Warning: com.unity.purchasing.googleplay.IabHelper$2$1: can't find referenced class com.google.vr.ndk.base.DaydreamApi Warning: com.unity.purchasing.googleplay.IabHelper$2$1: can't find referenced class com.google.vr.ndk.base.DaydreamApi Warning: com.unity.purchasing.googleplay.IabHelper$2$1: can't find referenced class com.google.vr.ndk.base.DaydreamApi Warning: com.unity.purchasing.googleplay.IabHelper$2$1: can't find referenced class com.google.vr.ndk.base.DaydreamApi Warning: com.unity.purchasing.googleplay.IabHelper$2$1: can't find referenced class com.google.vr.ndk.base.DaydreamApi Warning: there were 10 unresolved references to classes or interfaces. You may need to add missing library jars or update their versions. If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options. (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':transformClassesAndResourcesWithProguardForRelease'.

    java.io.IOException: Please correct the above warnings first.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. ]

Comment
Add comment · Show 3
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 bdgreen88 · Aug 22, 2017 at 03:26 PM 0
Share

I'm receiving this error as well and I did not change machines however I did recently upgrade to Unity 2017 but have had successful builds since. I was trying to add Google Play achievements so I had to add PlayGameServices plugin to my project and that's when all hell broke lose. So i deleted all my plugins and tried re-installing them as before without PlayGames and I can't get to a previous working state. I have the Same 10 references. I am using Facebook Plugin, Ad$$anonymous$$ob, and UnityIAP. Currently if I remove Unity IAP I can build with Ad$$anonymous$$ob and Facebook plugins. For me the problem seems to lie with a conflict between Unity IAP and Ad$$anonymous$$ob.

avatar image Olamire bdgreen88 · Aug 22, 2017 at 04:41 PM 0
Share

i thinks its IAP because some of the errors involve google daydream. i'm going back to 5.5

avatar image NinjaCalvin bdgreen88 · Oct 03, 2017 at 06:26 PM 0
Share

I just found this thread, I am having the same issue with the same plugins as you, however, I A$$anonymous$$ on a new machine, with Unity 2017.

I found a thread a while back about the Facebook SD$$anonymous$$ and Android SD$$anonymous$$ having some files with the same name, and so there was some conflicts when it tries to build out the AP$$anonymous$$ with multiple files named the same. They just deleted a few of the conflicting jar and meta files from the Facebook SD$$anonymous$$ Android libs folder: support-annotations-23.4.0.jar and it's meta file, and support-v4-23.4.0.aar and it's meta file.

I'm trying to find that post, I thought I had it bookmarked. I'll edit this and post it when I find it.

3 Replies

· Add your reply
  • Sort: 
avatar image
8

Answer by nanotribegmbh · Sep 18, 2017 at 11:25 AM

Here are the steps to overcome this issue;

  • Check "User Proguard File" under Publishing Settings for Android build

alt text

  • Open the generated proguard file and add the following line

-dontwarn com.google.vr.ndk.base.DaydreamApi

  • Make sure that you do not have`debuggable=true` in any of your AndroidManifest.xml files.


build-settings.png (9.1 kB)
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 carsonhui · Sep 26, 2017 at 08:00 PM 0
Share

Thank you.

avatar image NinjaCalvin · Oct 03, 2017 at 07:07 PM 0
Share

Yup. Worked for me too! Thanks!

avatar image officialmanojsh · Jul 31, 2018 at 04:11 PM 0
Share

thank you very much :D

avatar image
2

Answer by Mese · Sep 15, 2017 at 12:17 PM

Having the same problem here,

I found an open issue about it

https://issuetracker.unity3d.com/issues/gradle-proguard-build-fails-giving-confusing-error-about-11-duplicate-class-definitions

The workaround is to dont use Proguard on the Minify. Upvote the issue so it gets fixed and we may use Proguard as Minify.

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 zahrasoltani · Jun 12, 2018 at 07:47 AM

i had this problem so i set Internal(default) for Build system in player settings inspector ,and my problem solved :) hope to help :)

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

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

75 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

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