Admob (Google Mobile Ads SDK for unity) と Facebook Audience Network SDK for unity を使用してビルドすると、このエラーが発生します。プロジェクトでこれらのいずれかを個別に使用するとエラーは発生しませんが、これらの両方を使用すると、ビルド時にこのエラーが発生し始めます。ただし、テストしたところ、このエラーは Unity 2020 バージョンでは表示されず、Unity 2018 および 2019 バージョンのすべてで発生することが確認できました。このエラーを解決するために私を助けてください。
必要に応じてプロジェクトの完全なファイルを共有できますが、Admob unity SDK と Facebook オーディエンス ネットワーク unity sdk を追加し、Android プラットフォーム用のプロジェクトをビルドすることで簡単に再現できます。
私は使っている:
- Unityエディター 2018.4.30 LTS版
- Admob SDK (Google Mobile Ads SDK) バージョン 5.4.0
- Facebook オーディエンス ネットワーク バージョン 6.2.0
- スクリプティング バックエンド: IL2CPP
- JDK: jdk1.8.0_271
Unity コンソール エラーの詳細:
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Java\jdk1.8.0_271\bin\java.exe -classpath "C:\Program Files\UnityInstallFolder\Unity_2018.4.30\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processReleaseResources'.
> Android resource linking failed
D:\Projects\ADS Packages\ReportingProjectSample\Temp\gradleOut\build\intermediates\merged_manifests\release\AndroidManifest.xml:36: AAPT: error: unexpected element <queries> found in <manifest>.
* 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 6s
]
stdout[
> Task :preBuild UP-TO-DATE
> Task :GoogleMobileAdsPlugin.androidlib:preBuild UP-TO-DATE
> Task :GoogleMobileAdsPlugin.androidlib:preReleaseBuild UP-TO-DATE
> Task :GoogleMobileAdsPlugin.androidlib:checkReleaseManifest
> Task :GoogleMobileAdsPlugin.androidlib:processReleaseManifest
> Task :preReleaseBuild UP-TO-DATE
> Task :GoogleMobileAdsPlugin.androidlib:compileReleaseAidl NO-SOURCE
> Task :compileReleaseAidl NO-SOURCE
> Task :GoogleMobileAdsPlugin.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :compileReleaseRenderscript NO-SOURCE
> Task :checkReleaseManifest UP-TO-DATE
> Task :generateReleaseBuildConfig UP-TO-DATE
> Task :prepareLintJar UP-TO-DATE
> Task :generateReleaseSources UP-TO-DATE
> Task :GoogleMobileAdsPlugin.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :GoogleMobileAdsPlugin.androidlib:generateReleaseBuildConfig
> Task :GoogleMobileAdsPlugin.androidlib:generateReleaseResValues
> Task :GoogleMobileAdsPlugin.androidlib:generateReleaseResources
> Task :GoogleMobileAdsPlugin.androidlib:packageReleaseResources
> Task :GoogleMobileAdsPlugin.androidlib:generateReleaseRFile
> Task :GoogleMobileAdsPlugin.androidlib:prepareLintJar UP-TO-DATE
> Task :GoogleMobileAdsPlugin.androidlib:generateReleaseSources
> Task :GoogleMobileAdsPlugin.androidlib:javaPreCompileRelease
> Task :GoogleMobileAdsPlugin.androidlib:compileReleaseJavaWithJavac
> Task :GoogleMobileAdsPlugin.androidlib:bundleLibCompileRelease
> Task :javaPreCompileRelease UP-TO-DATE
> Task :mainApkListPersistenceRelease UP-TO-DATE
> Task :generateReleaseResValues UP-TO-DATE
> Task :generateReleaseResources UP-TO-DATE
> Task :mergeReleaseResources
> Task :createReleaseCompatibleScreenManifests
> Task :processReleaseManifest
> Task :processReleaseResources FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
21 actionable tasks: 13 executed, 8 up-to-date
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <267278aa48b840c7a0e7281223ea050e>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <267278aa48b840c7a0e7281223ea050e>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <267278aa48b840c7a0e7281223ea050e>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <267278aa48b840c7a0e7281223ea050e>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <267278aa48b840c7a0e7281223ea050e>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <267278aa48b840c7a0e7281223ea050e>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <267278aa48b840c7a0e7281223ea050e>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <267278aa48b840c7a0e7281223ea050e>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <267278aa48b840c7a0e7281223ea050e>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <267278aa48b840c7a0e7281223ea050e>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <267278aa48b840c7a0e7281223ea050e>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <267278aa48b840c7a0e7281223ea050e>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:288)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)