Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

FAILURE: Build failed with an exception.

Discussion in 'Editor & General Support' started by interpretasyo, Jun 29, 2020.

  1. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Hi,

    I saw that there's already existing thread about this but still, I cannot make my build to work.
    It's saying alot of duplicate class, but where should I delete the duplicate class?
    FYI also, I have added GetSocial and Facebook and after that, the issue happens.

    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':checkReleaseDuplicateClasses'.
    > 1 exception was raised by workers:
    java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.android.installreferrer.BuildConfig found in modules classes.jar :)com.android.installreferrer.installreferrer-1.0:) and classes.jar :)installreferrer-1.0:)
    Duplicate class com.android.installreferrer.api.InstallReferrerClient found in modules classes.jar :)com.android.installreferrer.installreferrer-1.0:) and classes.jar :)installreferrer-1.0:)
    Duplicate class com.android.installreferrer.api.InstallReferrerClient$1 found in modules classes.jar :)com.android.installreferrer.installreferrer-1.0:) and classes.jar :)installreferrer-1.0:)
    Duplicate class com.android.installreferrer.api.InstallReferrerClient$Builder found in modules classes.jar :)com.android.installreferrer.installreferrer-1.0:) and classes.jar :)installreferrer-1.0:)
    Duplicate class com.android.installreferrer.api.InstallReferrerClient$InstallReferrerResponse found in modules classes.jar :)com.android.installreferrer.installreferrer-1.0:) and classes.jar :)installreferrer-1.0:)
    Duplicate class com.android.installreferrer.api.InstallReferrerClientImpl found in modules classes.jar :)com.android.installreferrer.installreferrer-1.0:) and classes.jar :)installreferrer-1.0:)
    ...
     
  2. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    I don't know if this will help but here's the code inside display libraries.
    Code (CSharp):
    1. ([rootProject] + (rootProject.subprojects as List)).each { project ->
    2.     project.repositories {
    3.         def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
    4.         maven {
    5.             url "https://maven.google.com"
    6.         }
    7.         mavenLocal()
    8.         jcenter()
    9.         mavenCentral()
    10.     }
    11. }
    12. dependencies {
    13.     implementation 'com.android.support:appcompat-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    14.     implementation 'com.android.support:cardview-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    15.     implementation 'com.android.support:customtabs:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    16.     implementation 'com.android.support:support-v4:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    17.     implementation 'com.facebook.android:facebook-applinks:[7.1.0, 8)' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:6
    18.     implementation 'com.facebook.android:facebook-core:[7.1.0, 8)' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:5
    19.     implementation 'com.facebook.android:facebook-gamingservices:[7.1.0, 8)' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:9
    20.     implementation 'com.facebook.android:facebook-login:[7.1.0, 8)' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:7
    21.     implementation 'com.facebook.android:facebook-share:[7.1.0, 8)' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:8
    22.     implementation 'com.parse.bolts:bolts-android:1.4.0' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:4
    23. }
    24. android {
    25.   packagingOptions {
    26.       exclude ('/lib/armeabi/*' + '*')
    27.       exclude ('/lib/mips/*' + '*')
    28.       exclude ('/lib/mips64/*' + '*')
    29.       exclude ('/lib/x86/*' + '*')
    30.       exclude ('/lib/x86_64/*' + '*')
    31.   }
    32. }
     
  3. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,298
    For those stumbling across this, here is what worked for me:
    Try to remove all lines where "// Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency" is present. These seems to originate from the Facebook.Unity.Editor.dll and should not be part of any build.

    See: https://github.com/facebook/facebook-sdk-for-unity/issues/386