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

Error building in Gradle: setTestClassesDir(File) Method has been deprecated

Discussion in 'Android' started by kurtiswoww, Feb 23, 2018.

  1. kurtiswoww

    kurtiswoww

    Joined:
    Oct 2, 2013
    Posts:
    16
    Hey,

    We are trying to build via Gradle in Unity and we face this problem.

    CommandInvokationFailure: Gradle build failed.
    /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -classpath "/Applications/Unity 2017.3.1/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.

    * What went wrong:
    Execution failed for task ':transformNativeLibsWithMergeJniLibsForDebug'.
    > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK lib/armeabi-v7a/libgpg.so
    File1: /Users/simplemachine/.android/build-cache/2179c234f09dca7a43a54688509393177587680b/output/jni
    File2: /Users/simplemachine/.android/build-cache/d51c8f0381dbb42cf1bc4fe16970d8edec7d8e4e/output/jni


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

    BUILD FAILED in 19s
    ]
    stdout[
    The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
    The getTestClassesDir() method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the getTestClassesDirs() method instead.
    The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
    :preBuild UP-TO-DATE
    :preDebugBuild UP-TO-DATE
    :checkDebugManifest
    :preReleaseBuild UP-TO-DATE
    :prepareAnimatedVectorDrawable2531Library
    :prepareAppcompatV72531Library
    :prepareCardviewV72531Library
    :prepareComAndroidSupportAnimatedVectorDrawable2531Library
    :prepareComAndroidSupportAppcompatV72531Library
    :prepareComAndroidSupportCardviewV72531Library
    :prepareComAndroidSupportCustomtabs2531Library
    :prepareComAndroidSupportSupportCompat2531Library
    :prepareComAndroidSupportSupportCoreUi2531Library
    :prepareComAndroidSupportSupportCoreUtils2531Library
    :prepareComAndroidSupportSupportFragment2531Library
    :prepareComAndroidSupportSupportMediaCompat2531Library
    :prepareComAndroidSupportSupportV42531Library
    :prepareComAndroidSupportSupportVectorDrawable2531Library
    :prepareComGoogleAndroidGmsPlayServicesAuth1162Library
    :prepareComGoogleAndroidGmsPlayServicesAuthApiPhone1162Library
    :prepareComGoogleAndroidGmsPlayServicesAuthApiPhoneLicense1162Library
    :prepareComGoogleAndroidGmsPlayServicesAuthBase1162Library
    :prepareComGoogleAndroidGmsPlayServicesAuthBaseLicense1162Library
    :prepareComGoogleAndroidGmsPlayServicesBase1162Library
    :prepareComGoogleAndroidGmsPlayServicesBaseLicense1162Library
    :prepareComGoogleAndroidGmsPlayServicesBasement1162Library
    :prepareComGoogleAndroidGmsPlayServicesBasementLicense1162Library
    :prepareComGoogleAndroidGmsPlayServicesDrive1162Library
    :prepareComGoogleAndroidGmsPlayServicesDriveLicense1162Library
    :prepareComGoogleAndroidGmsPlayServicesGames1162Library
    :prepareComGoogleAndroidGmsPlayServicesGamesLicense1162Library
    :prepareComGoogleAndroidGmsPlayServicesNearby1162Library
    :prepareComGoogleAndroidGmsPlayServicesNearbyLicense1162Library
    :prepareComGoogleAndroidGmsPlayServicesTasks1162Library
    :prepareComGoogleAndroidGmsPlayServicesTasksLicense1162Library
    :prepareComGoogleGamesGpgsPluginSupport0950Library
    :prepareCustomtabs2531Library
    :prepareFacebookAndroidSdk4230Library
    :prepareFacebookAndroidWrapper7101Library
    :prepareGpgsPluginSupport0950Library
    :preparePlayServicesAuth1162Library
    :preparePlayServicesAuthApiPhone1162Library
    :preparePlayServicesAuthApiPhoneLicense1162Library
    :preparePlayServicesAuthBase1162Library
    :preparePlayServicesAuthBaseLicense1162Library
    :preparePlayServicesBase1162Library
    :preparePlayServicesBaseLicense1162Library
    :preparePlayServicesBasement1162Library
    :preparePlayServicesBasementLicense1162Library
    :preparePlayServicesDrive1162Library
    :preparePlayServicesDriveLicense1162Library
    :preparePlayServicesGames1162Library
    :preparePlayServicesGamesLicense1162Library
    :preparePlayServicesNearby1162Library
    :preparePlayServicesNearbyLicense1162Library
    :preparePlayServicesTasks1162Library
    :preparePlayServicesTasksLicense1162Library
    :prepareSupportCompat2531Library
    :prepareSupportCoreUi2531Library
    :prepareSupportCoreUtils2531Library
    :prepareSupportFragment2531Library
    :prepareSupportMediaCompat2531Library
    :prepareSupportV42531Library
    :prepareSupportVectorDrawable2531Library
    :GooglePlayGamesManifest.plugin:preBuild UP-TO-DATE
    :GooglePlayGamesManifest.plugin:preReleaseBuild UP-TO-DATE
    :GooglePlayGamesManifest.plugin:checkReleaseManifest
    :GooglePlayGamesManifest.plugin:prepareReleaseDependencies
    :GooglePlayGamesManifest.plugin:compileReleaseAidl
    :GooglePlayGamesManifest.plugin:compileReleaseNdk NO-SOURCE
    :GooglePlayGamesManifest.plugin:compileLint
    :GooglePlayGamesManifest.plugin:copyReleaseLint NO-SOURCE
    :GooglePlayGamesManifest.plugin:mergeReleaseShaders
    :GooglePlayGamesManifest.plugin:compileReleaseShaders
    :GooglePlayGamesManifest.plugin:generateReleaseAssets
    :GooglePlayGamesManifest.plugin:mergeReleaseAssets
    :GooglePlayGamesManifest.plugin:mergeReleaseProguardFiles
    :GooglePlayGamesManifest.plugin:packageReleaseRenderscript NO-SOURCE
    :GooglePlayGamesManifest.plugin:compileReleaseRenderscript
    :GooglePlayGamesManifest.plugin:generateReleaseResValues
    :GooglePlayGamesManifest.plugin:generateReleaseResources
    :GooglePlayGamesManifest.plugin:packageReleaseResources
    :GooglePlayGamesManifest.plugin:processReleaseManifest
    :GooglePlayGamesManifest.plugin:generateReleaseBuildConfig
    :GooglePlayGamesManifest.plugin:processReleaseResources
    :GooglePlayGamesManifest.plugin:generateReleaseSources
    :GooglePlayGamesManifest.plugin:incrementalReleaseJavaCompilationSafeguard
    :GooglePlayGamesManifest.plugin:javaPreCompileRelease
    :GooglePlayGamesManifest.plugin:compileReleaseJavaWithJavac
    :GooglePlayGamesManifest.plugin:processReleaseJavaRes NO-SOURCE
    :GooglePlayGamesManifest.plugin:transformResourcesWithMergeJavaResForRelease
    :GooglePlayGamesManifest.plugin:transformClassesAndResourcesWithSyncLibJarsForRelease
    :GooglePlayGamesManifest.plugin:mergeReleaseJniLibFolders
    :GooglePlayGamesManifest.plugin:transformNativeLibsWithMergeJniLibsForRelease
    :GooglePlayGamesManifest.plugin:transformNativeLibsWithStripDebugSymbolForRelease
    :GooglePlayGamesManifest.plugin:transformNativeLibsWithSyncJniLibsForRelease
    :GooglePlayGamesManifest.plugin:bundleRelease
    :prepareDebugDependencies
    :compileDebugAidl
    :compileDebugRenderscript
    :generateDebugBuildConfig
    :generateDebugResValues
    :generateDebugResources
    :mergeDebugResources
    :processDebugManifest
    :processDebugResources
    :generateDebugSources
    :incrementalDebugJavaCompilationSafeguard
    :javaPreCompileDebug
    :compileDebugJavaWithJavac
    :compileDebugNdk NO-SOURCE
    :compileDebugSources
    :mergeDebugShaders
    :compileDebugShaders
    :generateDebugAssets
    :mergeDebugAssets
    :transformClassesWithDexForDebug
    :mergeDebugJniLibFolders
    :transformNativeLibsWithMergeJniLibsForDebug FAILED
    102 actionable tasks: 102 executed
    ]
     
  2. mr_zog

    mr_zog

    Joined:
    Jan 21, 2014
    Posts:
    165
    Hi, did you fix this issue?
     
  3. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Looks like you have google play games plugin added twice.
     
    Andrey-Postelzhuk likes this.