【Unity】Androidへのビルドでエラーした時の対処法

今回、Unityで作成したゲームをAndroid向けにリリースするために設定をしてビルドしたのですが、「Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 24・・・」、「Execution failed for task ‘:launcher:checkReleaseDuplicateClasses’.」のエラーが発生したので、エラー解決までに行なった対処法を備忘録として残しておきます。
開発環境は下記のとおりです。

  • Unity 2020.3.17f1
  • PC MacBook Pro(13-inch, 2018, Four Thunderbolt 3 Ports)
  • OS macOS Monterey バージョン12.4

実行環境は下記のとおりです。

  • Android Xperia 10 II
  • OS Android 11

「Manifest merger failed : ・・・」のエラー

エラー内容

実機デバッグを行おうとした際に発生したエラーです。実機デバッグは下記のサイトを参考に設定を行いました。

設定を進めていき「Build And Run」を実行すると下記のポップアップが表示され、ビルドに失敗しました。

Build failure
Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 24 declared in library [:NatShare:] /Users/Admin/.gradle/caches/transforms-2/files-2.1/91b8a9dad3dcdf5c5a63527a9e0ab548/NatShare/AndroidManifest.xml as the library might be using APIs not available in 19 See the Console for details.

対応策

今回開発したゲーム内に含まれるライブラリを使うにはSDKのバージョン24以上が必要です。
現在指定しているのはバージョン19みたいなことを言っている。(はず)
なので、SDKのバージョンを下記の方法で設定し直します。

「Build Settings」>「Player Settings」>「Player」>「Androidマークのタブ」>「Other Setting」を開きます。

「Other Settings」の中から「Identification」>「Minimum API Level」でSDKのバージョンを選択します。
今回はAPI level 24以上が求められているので「Android 7.0 ‘Nougat'(API level 24)」を選択します。

以上を設定することで無事ビルドに成功し、実機で動作を確認することができました。

「Execution failed for task ‘:launcher:・・・」のエラー

エラー内容

リリース向けにビルドした時に発生したエラーです。リリースに向けたビルドは下記サイトを参考に設定を行いました。

<2022/8/6追記>こちらのエラーですが、AdmodとNatShareの競合が原因でした。 解決方法についても別の方法がありましたので修正いたします。

設定を進めていきビルドすると、失敗し下記のエラーログが出てきました。

> Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8

> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :unityLibrary:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
> Task :launcher:extractProguardFiles UP-TO-DATE
> Task :launcher:preReleaseBuild UP-TO-DATE
> Task :launcher:compileReleaseRenderscript NO-SOURCE
> Task :launcher:generateReleaseResValues UP-TO-DATE
> Task :launcher:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseResValues
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseResources
> Task :unityLibrary:packageReleaseResources UP-TO-DATE
> Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :unityLibrary:extractDeepLinksRelease UP-TO-DATE
> Task :launcher:extractDeepLinksRelease UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseResources
> Task :unityLibrary:compileReleaseLibraryResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:extractDeepLinksRelease
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseLibraryResources
> Task :unityLibrary:processReleaseManifest
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:processReleaseManifest
> Task :launcher:mergeReleaseResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
> Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseBuildConfig
> Task :unityLibrary:processReleaseJavaRes NO-SOURCE
> Task :unityLibrary:bundleLibResRelease NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:parseReleaseLocalResources
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:processReleaseJavaRes NO-SOURCE
> Task :unityLibrary:mergeReleaseShaders UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibResRelease NO-SOURCE
> Task :unityLibrary:compileReleaseShaders NO-SOURCE
> Task :unityLibrary:generateReleaseAssets UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseShaders
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseShaders NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseAssets UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseAssets
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseRFile
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:javaPreCompileRelease
> Task :unityLibrary:packageReleaseAssets
> Task :unityLibrary:generateReleaseRFile UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseJavaWithJavac
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseGeneratedProguardFiles
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseJniLibFolders
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibRuntimeToJarRelease
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibCompileToJarRelease
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:exportReleaseConsumerProguardFiles
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseNativeLibs
> Task :launcher:processReleaseManifest
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:stripReleaseDebugSymbols NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:copyReleaseJniLibsProjectOnly
> Task :launcher:checkReleaseDuplicateClasses FAILED
> Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
> Task :launcher:bundleReleaseResources
39 actionable tasks: 24 executed, 15 up-to-date

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class android.support.v4.graphics.drawable.IconCompatParcelizer found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class android.support.v4.os.ResultReceiver found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class android.support.v4.os.ResultReceiver$1 found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.accessibilityservice.AccessibilityServiceInfoCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$1 found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$OnRequestPermissionsResultCallback found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$PermissionCompatDelegate found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$RequestPermissionsRequestCodeValidator found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$SharedElementCallback21Impl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$SharedElementCallback21Impl$1 found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityManagerCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityOptionsCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityOptionsCompat$ActivityOptionsCompatImpl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.AlarmManagerCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.AppComponentFactory found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.AppLaunchChecker found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.AppOpsManagerCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.BundleCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.BundleCompat$BundleCompatBaseImpl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ComponentActivity found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ComponentActivity$ExtraData found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.CoreComponentFactory found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.CoreComponentFactory$CompatWrapped found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.FrameMetricsAggregator found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.FrameMetricsAggregator$FrameMetricsApi24Impl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.FrameMetricsAggregator$FrameMetricsApi24Impl$1 found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.FrameMetricsAggregator$FrameMetricsBaseImpl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.FrameMetricsAggregator$MetricType found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.INotificationSideChannel found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.INotificationSideChannel$Stub found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.INotificationSideChannel$Stub$Proxy found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$CommandProcessor found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$CompatJobEngine found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$CompatWorkEnqueuer found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$CompatWorkItem found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$GenericWorkItem found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$JobServiceEngineImpl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$JobServiceEngineImpl$WrapperWorkItem found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$JobWorkEnqueuer found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$WorkEnqueuer found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NavUtils found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationBuilderWithBuilderAccessor found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Action found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Action$Builder found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Action$Extender found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Action$SemanticAction found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Action$WearableExtender found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$BadgeIconType found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$BigPictureStyle found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$BigTextStyle found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Builder found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$CarExtender found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$CarExtender$UnreadConversation found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$CarExtender$UnreadConversation$Builder found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$DecoratedCustomViewStyle found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Extender found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$GroupAlertBehavior found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$InboxStyle found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$MessagingStyle found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$MessagingStyle$Message found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$NotificationVisibility found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$StreamType found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Style found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$WearableExtender found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompatBuilder found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompatExtras found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompatJellybean found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompatSideChannelService found <message truncated>

CommandInvokationFailure: Gradle build failed. 
/Applications/Unity/Hub/Editor/2020.3.17f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2020.3.17f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "bundleRelease"

stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class android.support.v4.graphics.drawable.IconCompatParcelizer found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class android.support.v4.os.ResultReceiver found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class android.support.v4.os.ResultReceiver$1 found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.accessibilityservice.AccessibilityServiceInfoCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$1 found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$OnRequestPermissionsResultCallback found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$PermissionCompatDelegate found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$RequestPermissionsRequestCodeValidator found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$SharedElementCallback21Impl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityCompat$SharedElementCallback21Impl$1 found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityManagerCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityOptionsCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ActivityOptionsCompat$ActivityOptionsCompatImpl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.AlarmManagerCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.AppComponentFactory found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.AppLaunchChecker found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.AppOpsManagerCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.BundleCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.BundleCompat$BundleCompatBaseImpl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ComponentActivity found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.ComponentActivity$ExtraData found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.CoreComponentFactory found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.CoreComponentFactory$CompatWrapped found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.FrameMetricsAggregator found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.FrameMetricsAggregator$FrameMetricsApi24Impl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.FrameMetricsAggregator$FrameMetricsApi24Impl$1 found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.FrameMetricsAggregator$FrameMetricsBaseImpl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.FrameMetricsAggregator$MetricType found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.INotificationSideChannel found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.INotificationSideChannel$Stub found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.INotificationSideChannel$Stub$Proxy found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$CommandProcessor found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$CompatJobEngine found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$CompatWorkEnqueuer found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$CompatWorkItem found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$GenericWorkItem found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$JobServiceEngineImpl found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$JobServiceEngineImpl$WrapperWorkItem found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$JobWorkEnqueuer found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.JobIntentService$WorkEnqueuer found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NavUtils found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationBuilderWithBuilderAccessor found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Action found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Action$Builder found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Action$Extender found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Action$SemanticAction found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Action$WearableExtender found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$BadgeIconType found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$BigPictureStyle found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$BigTextStyle found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Builder found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$CarExtender found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$CarExtender$UnreadConversation found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$CarExtender$UnreadConversation$Builder found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$DecoratedCustomViewStyle found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Extender found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$GroupAlertBehavior found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$InboxStyle found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$MessagingStyle found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$MessagingStyle$Message found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$NotificationVisibility found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$StreamType found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$Style found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompat$WearableExtender found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompatBuilder found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) and jetified-core-1.0.0-rc02-runtime.jar (:core-1.0.0-rc02:)
  Duplicate class androidx.core.app.NotificationCompatExtras found in modules jetified-androidx.core.core-1.6.0-runtime.jar (:androidx.core.core-1.6.0:) a<message truncated>

Build completed with a result of 'Failed' in 108 seconds (107903 ms)

対応策<2022/8/6 追記>

AdmodとNatShareのクラスファイルが競合していることが今回発生しているエラーの原因でした。
以前対応策として書いた「Assets」>「Plugins」>「Android」以下のファイルを消す方法ですと、Androidの実機上で広告表示が出来なくなってしまいました。
そのため、下記の対応策を行なってください。

エラー内容を確認すると、「androidx.core.core-1.6.0」と「core-1.0.0-rc02」が競合していることが指摘されています。
androidx.core.core-1.6.0・・・Admodのライブラリ
core-1.0.0-re02・・・NatShareのライブラリ
となっています。
競合を解決するためにはどちらかを削除する必要があるので「core-1.0.0-re02」を削除します。
「androidx.core.core-1.6.0」を削除するとAdmodがエラーを起こして停止してしまいます。
「core-1.0.0-re02.aar」ファイルは下記の場所に格納されていました。
「/Users/”ユーザ名”/Documents/Game/Unity/FallingDownGirl_mob/Library/PackageCache/api.natsuite.natshare@1.2.6/Plugins/Android」
「/Users/”ユーザ名”/Documents/Game/Unity/FallingDownGirl_mob/」までがUnityのプロジェクトのパスとなっています。
「core-1.0.0-re02.aar」、「core-1.0.0-rc02.aar.meta」を削除します。

以上を行うことで、無事にビルドが通りました。


ちなみに、「androidx.core.core-1.6.0.aar」ファイルは下記の場所に格納されています。
「/Users/”ユーザ名”/Documents/Game/Unity/FallingDownGirl_mob/Assets/Plugins/Android」

<2022/8/6 追記>下記は間違えていた対処方法ですが、同じようなことを行いAdmodで広告が表示されなくなってしまった方がいるかもしれないので残しておきます。

エラー内容としてモジュールが重複しているというようなことがズラーと書かれています。
色々フォルダを見ていたところ、下記のフォルダに身に覚えのないファイルがたくさん作成されていたので削除しました。

Assets」>「Plugins」>「Android」に移動し、

  • baseProjectTemplate
  • googlemobileads-unity
  • GoogleMobileAdsPlugin.androidlib(フォルダ)

以外のファイルを削除します。

削除しても再び作成されてしまう場合は、下記の設定を変更します。
「Assets」>「External Dependency Manager」>「Android Resolver」>「Settings」を開きます。

設定画面がポップアップするので、下記2項目のチェックを外しOKボタンを押します。

  • Enable Auto-Resolution
  • Enable Resolution On Build

以上を設定することで無事ビルドに成功しました。

コメント

タイトルとURLをコピーしました