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 /
avatar image
0
Question by starmonlim · May 26, 2019 at 06:49 AM · androidunity 5facebooksdkbuild error

D8: Program type already present: com.facebook.unity.Constants

It was good before, but not after the Unity version Upgrade 2017.3 -> 2018.4 and changes Build Setting [Scripting Backedn] [Mono] -> [IL2CPP]


  1. version new project succeeded. i found documents but I do not know what to do.


[DOCUMENT] Fix duplicate class errors If a class appears more than once on the runtime classpath, you get an error similar to the following: Program type already present com.example.MyClass This error typically occurs due to one of the following circumstances: A binary dependency includes a library that your app also includes as a direct dependency. For example, your app declares a direct dependency on Library A and Library B, but Library A already includes Library B in its binary. To resolve this issue, remove Library B as a direct dependency. Your app has a local binary dependency and a remote binary dependency on the same library. To resolve this issue, remove one of the binary dependencies. [DOCUMENT END]


CommandInvokationFailure: Gradle build failed. C:\Program Files\Unity\Hub\Editor\2018.4.0f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2018.4.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

stderr[ D8: Program type already present: com.facebook.unity.Constants

FAILURE: Build failed with an exception.

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

    com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:

0~95 C:\Superjelly\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\0.jar, ~ C:\Superjelly\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\95.jar Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: com.facebook.unity.Constants

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

  • Get more help at https://help.gradle.org

BUILD FAILED in 16s ] stdout[ Observed package id 'tools' in inconsistent location 'C:\Users\juil\AppData\Local\Android\Sdk_tools' (Expected 'C:\Users\juil\AppData\Local\Android\Sdk\tools') :checkReleaseClasspath UP-TO-DATE :preBuild UP-TO-DATE :Firebase:preBuild UP-TO-DATE :Firebase:preReleaseBuild UP-TO-DATE :Firebase:checkReleaseManifest :Firebase:processReleaseManifest :GoogleMobileAdsPlugin:preBuild UP-TO-DATE :GoogleMobileAdsPlugin:preReleaseBuild UP-TO-DATE :GoogleMobileAdsPlugin:checkReleaseManifest :GoogleMobileAdsPlugin:processReleaseManifest :preReleaseBuild UP-TO-DATE :Firebase:compileReleaseAidl NO-SOURCE :GoogleMobileAdsPlugin:compileReleaseAidl NO-SOURCE :compileReleaseAidl NO-SOURCE :Firebase:packageReleaseRenderscript NO-SOURCE :GoogleMobileAdsPlugin:packageReleaseRenderscript NO-SOURCE :compileReleaseRenderscript :checkReleaseManifest UP-TO-DATE :generateReleaseBuildConfig UP-TO-DATE :prepareLintJar UP-TO-DATE :mainApkListPersistenceRelease UP-TO-DATE :generateReleaseResValues UP-TO-DATE :generateReleaseResources :Firebase:compileReleaseRenderscript :Firebase:generateReleaseResValues :Firebase:generateReleaseResources :Firebase:packageReleaseResources :GoogleMobileAdsPlugin:compileReleaseRenderscript :GoogleMobileAdsPlugin:generateReleaseResValues :GoogleMobileAdsPlugin:generateReleaseResources :GoogleMobileAdsPlugin:packageReleaseResources :mergeReleaseResources :createReleaseCompatibleScreenManifests :processReleaseManifest C:\Superjelly\Temp\gradleOut\src\main\AndroidManifest.xml:24:9-31:50 Warning: activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was tagged at AndroidManifest.xml:24 to replace other declarations but no other declaration present :splitsDiscoveryTaskRelease UP-TO-DATE :Firebase:generateReleaseRFile :GoogleMobileAdsPlugin:generateReleaseRFile :processReleaseResources :generateReleaseSources :Firebase:generateReleaseBuildConfig :Firebase:prepareLintJar UP-TO-DATE :Firebase:generateReleaseSources :Firebase:javaPreCompileRelease :Firebase:compileReleaseJavaWithJavac :Firebase:processReleaseJavaRes NO-SOURCE :Firebase:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease :GoogleMobileAdsPlugin:generateReleaseBuildConfig :GoogleMobileAdsPlugin:prepareLintJar UP-TO-DATE :GoogleMobileAdsPlugin:generateReleaseSources :GoogleMobileAdsPlugin:javaPreCompileRelease :GoogleMobileAdsPlugin:compileReleaseJavaWithJavac :GoogleMobileAdsPlugin:processReleaseJavaRes NO-SOURCE :GoogleMobileAdsPlugin:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease :javaPreCompileRelease UP-TO-DATE :compileReleaseJavaWithJavac UP-TO-DATE :compileReleaseNdk NO-SOURCE :compileReleaseSources UP-TO-DATE :lintVitalRelease :mergeReleaseShaders UP-TO-DATE :compileReleaseShaders UP-TO-DATE :generateReleaseAssets UP-TO-DATE :Firebase:mergeReleaseShaders :Firebase:compileReleaseShaders :Firebase:generateReleaseAssets :Firebase:packageReleaseAssets :GoogleMobileAdsPlugin:mergeReleaseShaders :GoogleMobileAdsPlugin:compileReleaseShaders :GoogleMobileAdsPlugin:generateReleaseAssets :GoogleMobileAdsPlugin:packageReleaseAssets :mergeReleaseAssets :transformClassesWithDexBuilderForRelease :transformDexArchiveWithExternalLibsDexMergerForRelease FAILED 49 actionable tasks: 35 executed, 14 up-to-date ] 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.Command.Run (System.String command, System.String args, System.String workingdir, 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 (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress) Rethrow as GradleInvokationException: Gradle build failed UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, 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)

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

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Zakboy- · Oct 31, 2019 at 11:33 AM

My issue was that I updated from FB SDK 7.17.2 or something to 7.18, but the package installer did not remove the previous wrapper for version 7.17. Check if you have both for some reason.

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 Sohaib_techverx · Nov 01, 2019 at 05:37 AM 0
Share

thanks, that was exactly the same scenario in my case. FB SD$$anonymous$$ did not remove the old libs.

avatar image raTar · Jan 17, 2020 at 10:46 AM 0
Share

Thank you sir! You just saved me.

I had to dig into the folders and found that it has Bolts file or something (which is duplicate with Firebase stuff too). So I searched Facebook SD$$anonymous$$ changelog (here) and found that my project used v 7.15 before I reimported with v 7.18. According to the link, v.7.18 has removed bolts framework but it was still there in my project. So I deleted that facebook folder, imported v 7.18 and I can build again.

avatar image
0

Answer by Sohaib_techverx · Oct 29, 2019 at 05:32 PM

@starmonlim Hi,

Were you able to solve this issue? I am getting the same error expect that its "D8: Program type already present: com.facebook.unity.FBLogin" for me.

Thanks

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.

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

Game Analytics & Facebook sdk android build error 1 Answer

How to get a public profile permission facebook sdk 0 Answers

Can't build for Android 0 Answers

Facebook SDK IGraphResult is returning null values in Unity 2017.1.0f3 1 Answer

How to do communication between apps. ( 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