GooglePlayGamesManifest.plugin 缺少 AndroidManifest.xml 文件。 [统一]

GooglePlayGamesManifest.plugin is missing AndroidManifest.xml file. [Unity]

我正在尝试在我的游戏中实现排行榜,但是在构建 Android 时出现此错误:

Project 'E:\Unity\Project\Cave Boat\Temp\StagingArea\android-libraries\GooglePlayGamesManifest.plugin' is missing AndroidManifest.xml file.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

我使用的插件是CloudOnce。运行时没有错误,只有在构建时才会出错。

该错误是 3 个之一,这是另外两个;

2:

    UnityException: Adding Android library projects failed!
UnityEditor.Android.AndroidLibraries.AddLibraryProject (System.String projectPropertiesPath) (at <5f8140421e7d41ada100b629c3033aa7>:0)
UnityEditor.Android.AndroidLibraries.FindAndAddLibraryProjects (System.String searchPattern) (at <5f8140421e7d41ada100b629c3033aa7>:0)
UnityEditor.Android.PostProcessor.Tasks.AddAndroidLibraries.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5f8140421e7d41ada100b629c3033aa7>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5f8140421e7d41ada100b629c3033aa7>: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 <5f8140421e7d41ada100b629c3033aa7>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <5f8140421e7d41ada100b629c3033aa7>: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 <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

3:

Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

刚遇到完全相同的问题(并找到了您的 post)。经过一些研究,我找到了以下答案:https://answers.unity.com/questions/1745738/android-sdk-not-found-or-invalid-in-unity.html and https://answers.unity.com/questions/1684441/android-sdk-not-found-error-in-unity-201930f1.html

请按照说明操作:

  1. 下载 Android Studio(带 SDK 管理器)https://developer.android.com/studio
  2. 运行 SDK 管理器
  3. 将 SDK 下载到特定文件夹
  4. 取消选中外部工具对话框中的“Android SDK Tools installed with Unity”并指定(在外部工具对话框中)安装 SDK 的具体文件夹
  5. 在 CloudOnce 设置中:“运行 设置”并保存配置
  6. 确保安装了 Target SDK (https://forum.unity.com/threads/still-target-android-sdk-of-24-not-installed-after-it-had-been-installed-by-android-studio-setting.534821/)

那么你应该可以构建你的项目了。让我们知道它是否也适合您!

我刚 运行 遇到这个问题,我通过以下步骤解决了它:

注意:我使用的是 CloudOnce 包。

  1. 确保您正确安装了 CloudOnce 软件包
  2. Unity > Window > CloudOnce > Editor
  3. 确保您已添加 google 播放 ID 并点击设置
  4. Save
  5. 它将生成一个 AndroidManifest.xml 文件: