Top 8
Outer WildsストーリーMODを色々やってみた
June 18, 2023, 10:04 a.m.表面符号と戯れる【量子コンピューター Advent Calendar 2023 23 日目】
Dec. 23, 2023, 3:28 a.m.位数発見アルゴリズム ~Quantum Zooやっていく【特別編】~
Jan. 27, 2023, 2:50 p.m.ストーリー追加 Mod: The Outsider やっていく日記【Outer Wilds】
Feb. 19, 2023, 6:33 a.m.意識が量子効果で生じることを示す実験結果についてちょっと調べただけのメモ
April 21, 2022, 3:09 p.m.ストーリー追加 MOD: Astral Codec やっていく日記【Outer Wilds】
Feb. 25, 2024, 8:47 a.m.Outer Wilds の量子は計算能力が(ある程度)すごいのではという話
Jan. 15, 2022, 8:35 a.m.MacでAge of Empires 2 DE (AoE2DE)をCrossOverで動かす
May 31, 2021, 11:52 a.m.Android Native ProとAdMobの競合の解決方法【Unity】
March 14, 2019, 3:02 a.m. edited March 14, 2019, 3:20 a.m.Unityはクロスプラットフォーム開発ができ,Android,iOS,Windows,...と様々なプラットフォーム向けにアプリをビルドすることができます.しかし,その分個別のプラットフォーム独自の機能にはどうしても弱くなってしまいます.そこで,Asset Storeにはこれを補うようなプラグインが数多くリリースされています.その中でAndroid向けのネイティブプラグインとして有名なのがSTAN'S ASSETSのAndroid Native Proです1.(普段は結構お高いアセットなのですが,いつかのセールのときにすごく安くなっていたので買ってしまっていました)
ここで,Android向けにアプリをリリースするUnityを利用する開発者の多くが導入するのがAdMob、Googleの広告です.
そして,この2つを一緒に使って開発し,いざビルドしてみると,
CommandInvokationFailure: Gradle build failed.
/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/java -classpath "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/arch/core/internal/SafeIterableMap;
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 1m 46s
]
stdout[
Starting a Gradle Daemon (subsequent builds will be faster)
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
:preReleaseBuild UP-TO-DATE
:checkReleaseManifest
:preDebugBuild UP-TO-DATE
:prepareAn_coreLibrary
:prepareAndroidArchCoreRuntime110Library
:prepareAndroidArchLifecycleLivedataCore110Library
:prepareAndroidArchLifecycleRuntime100Library
:prepareAndroidArchLifecycleRuntime110Library
:prepareAndroidArchLifecycleViewmodel110Library
:prepareComAndroidSupportAnimatedVectorDrawable2711Library
:prepareComAndroidSupportAppcompatV72711Library
:prepareComAndroidSupportCardviewV72711Library
:prepareComAndroidSupportCustomtabs2610Library
:prepareComAndroidSupportCustomtabs2711Library
:prepareComAndroidSupportSupportCompat2610Library
:prepareComAndroidSupportSupportCompat2711Library
:prepareComAndroidSupportSupportCoreUi2610Library
:prepareComAndroidSupportSupportCoreUi2711Library
:prepareComAndroidSupportSupportCoreUtils2610Library
:prepareComAndroidSupportSupportCoreUtils2711Library
:prepareComAndroidSupportSupportFragment2610Library
:prepareComAndroidSupportSupportFragment2711Library
:prepareComAndroidSupportSupportMediaCompat2610Library
:prepareComAndroidSupportSupportMediaCompat2711Library
:prepareComAndroidSupportSupportV42610Library
:prepareComAndroidSupportSupportV42711Library
:prepareComAndroidSupportSupportVectorDrawable2711Library
:prepareComGoogleAndroidGmsPlayServicesAds1501Library
:prepareComGoogleAndroidGmsPlayServicesAdsBase1501Library
:prepareComGoogleAndroidGmsPlayServicesAdsIdentifier1501Library
:prepareComGoogleAndroidGmsPlayServicesAdsLite1501Library
:prepareComGoogleAndroidGmsPlayServicesBasement1501Library
:prepareComGoogleAndroidGmsPlayServicesGass1501Library
:GoogleMobileAdsPlugin:preBuild UP-TO-DATE
:GoogleMobileAdsPlugin:preReleaseBuild UP-TO-DATE
:GoogleMobileAdsPlugin:checkReleaseManifest
:GoogleMobileAdsPlugin:prepareReleaseDependencies
:GoogleMobileAdsPlugin:compileReleaseAidl
:GoogleMobileAdsPlugin:compileReleaseNdk NO-SOURCE
:GoogleMobileAdsPlugin:compileLint
:GoogleMobileAdsPlugin:copyReleaseLint NO-SOURCE
:GoogleMobileAdsPlugin:mergeReleaseShaders
:GoogleMobileAdsPlugin:compileReleaseShaders
:GoogleMobileAdsPlugin:generateReleaseAssets
:GoogleMobileAdsPlugin:mergeReleaseAssets
:GoogleMobileAdsPlugin:mergeReleaseProguardFiles
:GoogleMobileAdsPlugin:packageReleaseRenderscript NO-SOURCE
:GoogleMobileAdsPlugin:compileReleaseRenderscript
:GoogleMobileAdsPlugin:generateReleaseResValues
:GoogleMobileAdsPlugin:generateReleaseResources
:GoogleMobileAdsPlugin:packageReleaseResources
:GoogleMobileAdsPlugin:processReleaseManifest
:GoogleMobileAdsPlugin:generateReleaseBuildConfig
:GoogleMobileAdsPlugin:processReleaseResources
:GoogleMobileAdsPlugin:generateReleaseSources
:GoogleMobileAdsPlugin:incrementalReleaseJavaCompilationSafeguard
:GoogleMobileAdsPlugin:javaPreCompileRelease
:GoogleMobileAdsPlugin:compileReleaseJavaWithJavac
:GoogleMobileAdsPlugin:processReleaseJavaRes NO-SOURCE
:GoogleMobileAdsPlugin:transformResourcesWithMergeJavaResForRelease
:GoogleMobileAdsPlugin:transformClassesAndResourcesWithSyncLibJarsForRelease
:GoogleMobileAdsPlugin:mergeReleaseJniLibFolders
:GoogleMobileAdsPlugin:transformNativeLibsWithMergeJniLibsForRelease
:GoogleMobileAdsPlugin:transformNativeLibsWithStripDebugSymbolForRelease
:GoogleMobileAdsPlugin:transformNativeLibsWithSyncJniLibsForRelease
:GoogleMobileAdsPlugin:bundleRelease
:an_library.bundle:preBuild UP-TO-DATE
:an_library.bundle:preReleaseBuild UP-TO-DATE
:an_library.bundle:checkReleaseManifest
:an_library.bundle:prepareReleaseDependencies
:an_library.bundle:compileReleaseAidl
:an_library.bundle:compileReleaseNdk NO-SOURCE
:an_library.bundle:compileLint
:an_library.bundle:copyReleaseLint NO-SOURCE
:an_library.bundle:mergeReleaseShaders
:an_library.bundle:compileReleaseShaders
:an_library.bundle:generateReleaseAssets
:an_library.bundle:mergeReleaseAssets
:an_library.bundle:mergeReleaseProguardFiles
:an_library.bundle:packageReleaseRenderscript NO-SOURCE
:an_library.bundle:compileReleaseRenderscript
:an_library.bundle:generateReleaseResValues
:an_library.bundle:generateReleaseResources
:an_library.bundle:packageReleaseResources
:an_library.bundle:processReleaseManifest
:an_library.bundle:generateReleaseBuildConfig
:an_library.bundle:processReleaseResources
:an_library.bundle:generateReleaseSources
:an_library.bundle:incrementalReleaseJavaCompilationSafeguard
:an_library.bundle:javaPreCompileRelease
:an_library.bundle:compileReleaseJavaWithJavac
:an_library.bundle:processReleaseJavaRes NO-SOURCE
:an_library.bundle:transformResourcesWithMergeJavaResForRelease
:an_library.bundle:transformClassesAndResourcesWithSyncLibJarsForRelease
:an_library.bundle:mergeReleaseJniLibFolders
:an_library.bundle:transformNativeLibsWithMergeJniLibsForRelease
:an_library.bundle:transformNativeLibsWithStripDebugSymbolForRelease
:an_library.bundle:transformNativeLibsWithSyncJniLibsForRelease
:an_library.bundle:bundleRelease
:prepareReleaseDependencies
:compileReleaseAidl
:compileReleaseRenderscript
:generateReleaseBuildConfig
:generateReleaseResValues
:generateReleaseResources
:mergeReleaseResources
:processReleaseManifest
:processReleaseResources
:generateReleaseSources
:incrementalReleaseJavaCompilationSafeguard
:javaPreCompileRelease
:compileReleaseJavaWithJavac
:compileReleaseNdk NO-SOURCE
:compileReleaseSources
:lintVitalRelease
:mergeReleaseShaders
:compileReleaseShaders
:generateReleaseAssets
:mergeReleaseAssets
:transformClassesWithDexForRelease FAILED
95 actionable tasks: 95 executed
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <a798aa15a3b64b78b7b748372c1177e2>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <a798aa15a3b64b78b7b748372c1177e2>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <a798aa15a3b64b78b7b748372c1177e2>:0)
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1[T] progress) (at <a798aa15a3b64b78b7b748372c1177e2>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1[T] progress) (at <a798aa15a3b64b78b7b748372c1177e2>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <a798aa15a3b64b78b7b748372c1177e2>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <a798aa15a3b64b78b7b748372c1177e2>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
というようなエラーが出てしまいます.Multiple dex files...
とあるように同じjarやaarといったファイルがバージョン違えど複数あるのが原因です.そのため,例えばAssets/Plugins/Android/android.arch.core.common-1.0.0.jar
というような被っているファイルを削除したいのですが,これを削除すると強制的にAdMobのPlay Services Resolverが走ってせっかく消したファイルを復活させてしまいます.
では,どうすればよいのかというと,Android Native Proの公式ホームページにヒントがありました.
これにしたがって以下の図に示すように,Unity Jar Resolverを動かします.
すると,Android Native ProとAdMobの競合が解決され,きれいにAssets/Plugins/Android/
以下にプラグインが並べられました!
こうしてビルドすると問題なくアプリは動き,Android Native ProとAdMob双方の機能も問題なく動きました.
-
iOS向けにはIOS Native Proがあります. ↩
Top 8
Outer WildsストーリーMODを色々やってみた
June 18, 2023, 10:04 a.m.表面符号と戯れる【量子コンピューター Advent Calendar 2023 23 日目】
Dec. 23, 2023, 3:28 a.m.位数発見アルゴリズム ~Quantum Zooやっていく【特別編】~
Jan. 27, 2023, 2:50 p.m.ストーリー追加 Mod: The Outsider やっていく日記【Outer Wilds】
Feb. 19, 2023, 6:33 a.m.意識が量子効果で生じることを示す実験結果についてちょっと調べただけのメモ
April 21, 2022, 3:09 p.m.ストーリー追加 MOD: Astral Codec やっていく日記【Outer Wilds】
Feb. 25, 2024, 8:47 a.m.Outer Wilds の量子は計算能力が(ある程度)すごいのではという話
Jan. 15, 2022, 8:35 a.m.MacでAge of Empires 2 DE (AoE2DE)をCrossOverで動かす
May 31, 2021, 11:52 a.m.Tags
- #Python (26)
- #量子力学 (25)
- #量子情報 (23)
- #Unity (11)
- #Outer Wilds (11)
- #数学 (9)
- #Mac (9)
- #AoE2 (8)
- #Linux (7)
- #Quantum Zoo (6)
- #意識 (5)
- #シミュレーション (5)
- #NumPy (5)
- #Bash (5)
- #相対論 (4)
- #Docker (4)
- #Android (4)
- #Qiskit (4)
- #Rust (3)
- #PyO3 (3)
- #GitHub (3)
- #Django (2)
- #情報理論 (2)
- #LaTeX (2)
- #AR (2)
- #Git (2)
- #iOS (2)
- #C++ (2)
- #正規表現 (2)
- #論文 (2)
- #電磁気学 (1)
- #Google Drive (1)
- #Overleaf (1)
- #Let's Encrypt (1)
- #ポケモン (1)
- #AdMob (1)
- #Autoya (1)
- #docopt (1)
- #SymPy (1)
- #AWS (1)
- #Twitter (1)
- #URP (1)
- #iMovie (1)
- #PyTorch (1)
- #C# (1)
- #Vim (1)