Home > Software engineering >  Why I can't build my project why this error?
Why I can't build my project why this error?

Time:09-12

Why I can't build my project why this error? I tried Delete Resolved Libraries then I can build my project. but My project was played in android and crashed. Any help would appreciated. Here's the errors:

Task :unityLibrary:GooglePlayGamesManifest.androidlib:preBuild UP-TO-DATE Task :launcher:preBuild UP-TO-DATE Task :unityLibrary:preBuild UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:preReleaseBuild UP-TO-DATE Task :unityLibrary:preReleaseBuild UP-TO-DATE Task :unityLibrary:checkReleaseManifest UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:checkReleaseManifest Task :launcher:prepareLintJar UP-TO-DATE Task :unityLibrary:processReleaseManifest Task :unityLibrary:packageReleaseRenderscript NO-SOURCE Task :unityLibrary:GooglePlayGamesManifest.androidlib:processReleaseManifest Task :unityLibrary:GooglePlayGamesManifest.androidlib:compileReleaseAidl NO-SOURCE Task :unityLibrary:compileReleaseAidl NO-SOURCE Task :launcher:preReleaseBuild Task :launcher:compileReleaseAidl NO-SOURCE Task :launcher:compileReleaseRenderscript NO-SOURCE Task :launcher:checkReleaseManifest UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:packageReleaseRenderscript NO-SOURCE Task :launcher:generateReleaseBuildConfig UP-TO-DATE Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE Task :launcher:generateReleaseSources UP-TO-DATE Task :unityLibrary:compileReleaseRenderscript NO-SOURCE Task :unityLibrary:generateReleaseResValues UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:compileReleaseRenderscript NO-SOURCE Task :unityLibrary:generateReleaseResources UP-TO-DATE Task :launcher:mainApkListPersistenceRelease UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:generateReleaseResValues Task :unityLibrary:GooglePlayGamesManifest.androidlib:generateReleaseResources Task :unityLibrary:packageReleaseResources UP-TO-DATE Task :unityLibrary:prepareLintJar UP-TO-DATE Task :unityLibrary:generateReleaseSources UP-TO-DATE Task :launcher:generateReleaseResValues UP-TO-DATE Task :launcher:generateReleaseResources UP-TO-DATE Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:packageReleaseResources Task :unityLibrary:mergeReleaseShaders UP-TO-DATE Task :unityLibrary:compileReleaseShaders UP-TO-DATE Task :unityLibrary:generateReleaseAssets UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:generateReleaseRFile Task :unityLibrary:GooglePlayGamesManifest.androidlib:generateReleaseBuildConfig Task :unityLibrary:GooglePlayGamesManifest.androidlib:prepareLintJar UP-TO-DATE Task :unityLibrary:GooglePlayGamesManifest.androidlib:generateReleaseSources Task :unityLibrary:GooglePlayGamesManifest.androidlib:javaPreCompileRelease Task :launcher:processReleaseManifest

Note: D:\MyGitProject\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':launcher:checkReleaseDuplicateClasses'.

1 exception was raised by workers: java.lang.RuntimeException: Duplicate class com.google.android.gms.games.AchievementsClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.AnnotatedData found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.CurrentPlayerInfo found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.EventsClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.FriendsResolutionRequiredException found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Game found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GameBuffer found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GameEntity found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GameRef found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Games found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Games$GetServerAuthCodeResult found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesActivityResultCodes found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesCallbackStatusCodes found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesClientStatusCodes found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesMetadata found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesMetadataClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesStatusCodes found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.LeaderboardsClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.LeaderboardsClient$LeaderboardScores found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PageDirection found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PageDirection$Direction found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Player found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Player$FriendsListVisibilityStatus found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Player$PlayerFriendStatus found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerBuffer found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerEntity found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerLevel found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerLevelInfo found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerRef found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerRelationshipInfo found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerStatsClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Players found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayersClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.SnapshotsClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.SnapshotsClient$DataOrConflict found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.SnapshotsClient$ResolutionPolicy found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.SnapshotsClient$SnapshotConflict found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.SnapshotsClient$SnapshotContentUnavailableApiException found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.VideosClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.VideosClient$CaptureOverlayState found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.VideosClient$OnCaptureOverlayStateListener found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.achievement.Achievement found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.achievement.Achievement$AchievementState found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.achievement.Achievement$AchievementType found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:)

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

stderr[ Note: D:\MyGitProject\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':launcher:checkReleaseDuplicateClasses'.

1 exception was raised by workers: java.lang.RuntimeException: Duplicate class com.google.android.gms.games.AchievementsClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.AnnotatedData found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.CurrentPlayerInfo found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.EventsClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.FriendsResolutionRequiredException found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Game found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GameBuffer found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GameEntity found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GameRef found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Games found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Games$GetServerAuthCodeResult found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesActivityResultCodes found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesCallbackStatusCodes found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesClientStatusCodes found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesMetadata found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesMetadataClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.GamesStatusCodes found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.LeaderboardsClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.LeaderboardsClient$LeaderboardScores found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PageDirection found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PageDirection$Direction found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Player found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Player$FriendsListVisibilityStatus found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.Player$PlayerFriendStatus found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerBuffer found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerEntity found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerLevel found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerLevelInfo found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerRef found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerRelationshipInfo found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:) Duplicate class com.google.android.gms.games.PlayerStatsClient found in modules classes.jar (:com.google.android.gms.play-services-games-21.0.0:) and classes.jar (:com.google.android.gms.play-services-games-v2-17.0.0:)

CodePudding user response:

As mentioned in the error logs, you have the same classes in 2 library com.google.android.gms.play-services-games-v2-17.0.0 and com.google.android.gms.play-services-games-21.0.0.

My suggestion is to disable the lib with the name com.google.android.gms.play-services-games-v2-17.0.0 for your targeted platform and then try to rebuild the project.

  • Related