我想将 Firebase 添加到我的 Unity 项目中。 我从这里关注了 Firebase 文档: https://firebase.google.com/docs/unity/setup-alternative#alternative_unity_package_manager。 我先导入了外部依赖管理器,没有问题。我从这里获取了 .tgz 文件(正如文档中所述)https://developers.google.com/unity/archive。 但是,导入 Firebase Core (com.google.firebase.app) 后,当我为 Android 构建时,出现以下错误:
在控制台中,我看到以下内容:
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
> 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 :launcher:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :unityLibrary:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:compileReleaseAidl NO-SOURCE
> Task :launcher:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:compileReleaseAidl NO-SOURCE
> Task :launcher:generateReleaseBuildConfig UP-TO-DATE
> Task :launcher:compileReleaseAidl NO-SOURCE
> Task :launcher:javaPreCompileRelease UP-TO-DATE
> Task :launcher:generateReleaseResValues UP-TO-DATE
> Task :launcher:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:packageReleaseResources UP-TO-DATE
> Task :unityLibrary:packageReleaseResources UP-TO-DATE
> Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :unityLibrary:extractDeepLinksRelease UP-TO-DATE
> Task :unityLibrary:processReleaseManifest FAILED
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
> Task :launcher:mergeReleaseResources
11 actionable tasks: 2 executed, 9 up-to-date
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
我一直试图找出导致错误的原因,但我不明白。据我所知,我的 Gradle 版本是最新的。控制台中列出的某些脚本是否是无源脚本?
我还尝试下载 Firebase SDK 并导入我想要的 Unity 包,但我得到了同样的错误。
对我有用的是
取消选中Build Settings => Player Settings => Publishing Settings => Build
中的所有内容在弹出的对话框中点击确定
将 Firebase Core Unity 包降级到版本 11.6.0(以及我的案例中的 Auth 和数据库包)
对我来说,这似乎是 Unity Firebase Core 包中的一个错误。 希望谷歌能够修复它。 我尝试降级到比 11.6.0 更新的版本,但这是最新的版本,没有显示错误