コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction See the Console for details.

概要

Unity に導入している Firebase 関連のパッケージを
11.6.0 から 11.8.1 にアップデートしてから Android ビルドしたら

A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction See the Console for details.

上記のエラーが表示されてビルドに失敗した
Console には以下のエラーが出力されていた

Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33

This Android Gradle plugin (7.1.2) was tested up to compileSdk = 32

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :unityLibrary:res.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:res.androidlib:preDebugBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preDebugBuild UP-TO-DATE
> Task :unityLibrary:preDebugBuild UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:preDebugBuild UP-TO-DATE
> Task :launcher:preDebugBuild UP-TO-DATE
> Task :unityLibrary:packageDebugRenderscript NO-SOURCE
> Task :unityLibrary:res.androidlib:compileDebugAidl NO-SOURCE
> Task :launcher:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:compileDebugAidl NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:compileDebugAidl NO-SOURCE
> Task :unityLibrary:compileDebugAidl NO-SOURCE
> Task :launcher:generateDebugBuildConfig UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:writeDebugAarMetadata UP-TO-DATE
> Task :unityLibrary:writeDebugAarMetadata UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:writeDebugAarMetadata UP-TO-DATE
> Task :unityLibrary:res.androidlib:writeDebugAarMetadata UP-TO-DATE
> Task :launcher:compileDebugAidl NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:packageDebugRenderscript NO-SOURCE
> Task :unityLibrary:res.androidlib:packageDebugRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:packageDebugRenderscript NO-SOURCE
> Task :unityLibrary:generateDebugResValues UP-TO-DATE
> Task :launcher:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:res.androidlib:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:generateDebugResValues UP-TO-DATE
> Task :unityLibrary:generateDebugResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:generateDebugResources UP-TO-DATE
> Task :unityLibrary:res.androidlib:generateDebugResValues UP-TO-DATE
> Task :launcher:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:generateDebugResValues UP-TO-DATE
> Task :unityLibrary:res.androidlib:generateDebugResources UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:generateDebugResources UP-TO-DATE
> Task :unityLibrary:res.androidlib:packageDebugResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:packageDebugResources UP-TO-DATE
> Task :unityLibrary:packageDebugResources UP-TO-DATE
> Task :unityLibrary:res.androidlib:extractDeepLinksDebug UP-TO-DATE
> Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:extractDeepLinksDebug UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:processDebugManifest UP-TO-DATE
> Task :unityLibrary:res.androidlib:processDebugManifest UP-TO-DATE
> Task :unityLibrary:processDebugManifest UP-TO-DATE
> Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
> Task :unityLibrary:res.androidlib:parseDebugLocalResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:parseDebugLocalResources UP-TO-DATE
> Task :unityLibrary:parseDebugLocalResources UP-TO-DATE
> Task :unityLibrary:generateDebugBuildConfig UP-TO-DATE
> Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:res.androidlib:generateDebugRFile UP-TO-DATE
> Task :unityLibrary:mergeDebugShaders UP-TO-DATE
> Task :unityLibrary:compileDebugShaders NO-SOURCE
> Task :unityLibrary:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:generateDebugRFile UP-TO-DATE
> Task :unityLibrary:res.androidlib:compileDebugLibraryResources UP-TO-DATE
> Task :unityLibrary:res.androidlib:generateDebugBuildConfig UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:compileDebugLibraryResources UP-TO-DATE
> Task :unityLibrary:res.androidlib:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:generateDebugBuildConfig UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:packageDebugResources
> Task :unityLibrary:FirebaseCrashlytics.androidlib:extractDeepLinksDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:processDebugManifest UP-TO-DATE
> Task :unityLibrary:res.androidlib:compileDebugJavaWithJavac UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:compileDebugJavaWithJavac UP-TO-DATE
> Task :unityLibrary:res.androidlib:bundleLibCompileToJarDebug UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:bundleLibCompileToJarDebug UP-TO-DATE
> Task :unityLibrary:res.androidlib:mergeDebugShaders UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:mergeDebugShaders UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:compileDebugShaders NO-SOURCE
> Task :unityLibrary:res.androidlib:compileDebugShaders NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:packageDebugAssets UP-TO-DATE
> Task :unityLibrary:res.androidlib:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:res.androidlib:packageDebugAssets UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:processDebugJavaRes NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:bundleLibResDebug NO-SOURCE
> Task :unityLibrary:res.androidlib:processDebugJavaRes NO-SOURCE
> Task :unityLibrary:res.androidlib:bundleLibResDebug NO-SOURCE
> Task :unityLibrary:res.androidlib:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:mergeDebugJniLibFolders UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:parseDebugLocalResources
> Task :unityLibrary:packageDebugAssets
> Task :unityLibrary:FirebaseApp.androidlib:mergeDebugNativeLibs NO-SOURCE
> Task :unityLibrary:res.androidlib:mergeDebugJniLibFolders UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:copyDebugJniLibsProjectOnly UP-TO-DATE
> Task :unityLibrary:res.androidlib:mergeDebugNativeLibs NO-SOURCE
> Task :unityLibrary:processDebugJavaRes UP-TO-DATE
> Task :unityLibrary:res.androidlib:copyDebugJniLibsProjectOnly UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:compileDebugLibraryResources
> Task :unityLibrary:bundleLibResDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:generateDebugRFile UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:generateDebugBuildConfig UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:compileDebugJavaWithJavac UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:bundleLibCompileToJarDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:mergeDebugShaders UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:compileDebugShaders NO-SOURCE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:packageDebugAssets UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:processDebugJavaRes NO-SOURCE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:bundleLibResDebug NO-SOURCE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:mergeDebugJniLibFolders UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:mergeDebugNativeLibs NO-SOURCE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:copyDebugJniLibsProjectOnly UP-TO-DATE
> Task :launcher:generateDebugResValues UP-TO-DATE
> Task :launcher:generateDebugResources UP-TO-DATE
> Task :launcher:checkDebugAarMetadata
> Task :unityLibrary:mergeDebugJniLibFolders
> Task :launcher:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :launcher:extractDeepLinksDebug UP-TO-DATE
> Task :launcher:mergeDebugResources
> Task :unityLibrary:generateDebugRFile
> Task :launcher:processDebugMainManifest
> Task :launcher:processDebugManifest
> Task :launcher:mergeDebugShaders UP-TO-DATE
> Task :launcher:compileDebugShaders NO-SOURCE
> Task :launcher:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:mergeDebugNativeLibs
> Task :launcher:mergeDebugAssets
> Task :launcher:processDebugJavaRes NO-SOURCE
> Task :launcher:compressDebugAssets
> Task :launcher:checkDebugDuplicateClasses
> Task :launcher:mergeDebugJavaResource FAILED
> Task :launcher:processDebugManifestForPackage

> Task :unityLibrary:compileDebugJavaWithJavac

> Task :launcher:desugarDebugFileDependencies
84 actionable tasks: 18 executed, 66 up-to-date

UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions)
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
??????:????????????????????????????????????????????????API?????????????????????????????????????????????????????????
??????:????????????-Xlint:deprecation?????????????????????????????????????????????????????????????????????

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'META-INF/kotlinx_coroutines_core.version'.
     Adding a packagingOptions block may help, please refer to
     https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
     for more information

* 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 57s

UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions)

Jenkins から Android ビルドする時は正常にビルドできるが
Unity エディタから Android ビルドする時は上記のエラーが出て
ビルドに失敗する状態だった

解決

Firebase 関係のパッケージをアップデートした後に Resolve する際に表示された
上記のダイアログで「Enable」を選択したらビルドに成功するようになった