gpt4 book ai didi

android - AndroidManifest 中的多个 ComponentDiscoveryService --> 合并冲突

转载 作者:太空宇宙 更新时间:2023-11-03 10:34:05 26 4
gpt4 key购买 nike

我使用的是 Unity 2018.1.0f2 和 Firebase 5.0.0。安装了 Android NDK/SDK 以及 Java 8 172。我已经为android做了一个强制解决Firebase 消息传递的快速入门项目运行良好,但是,如果我尝试以相同的方式在我的项目中实现 firebase 消息传递,则会引发以下错误:

> Error: [Temp\StagingArea\AndroidManifest-main.xml, E:\path\Temp\StagingArea\android-libraries\com.google.firebase.firebase-measurement-connector-impl-16.0.0\AndroidManifest.xml:10] Trying to merge incompatible /manifest/application/service[@name=com.google.firebase.components.ComponentDiscoveryService] element:

0x00000001414F00A9 (Unity) StackWalker::GetCurrentCallstack 0x00000001414F66B6 (Unity) StackWalker::ShowCallstack 0x000000014138F54B (Unity) GetStacktrace 0x0000000140888ADC (Unity) DebugStringToFile 0x0000000141F886A8 (Unity) DebugLogHandler_CUSTOM_Internal_Log 0x0000000052EE344B (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object) 0x0000000052EE3334 (Mono JIT Code) [DebugLogHandler.cs:9] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) 0x0000000052EE2C35 (Mono JIT Code) [Logger.cs:47] UnityEngine.Logger:Log (UnityEngine.LogType,object) 0x0000000052EE2953 (Mono JIT Code) [Debug.bindings.cs:117] UnityEngine.Debug:LogError (object) 0x000000004BE988E0 (Mono JIT Code) UnityEditor.Android.PostProcessor.PostProcessRunner:RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext) 0x0000000052EB7664 (Mono JIT Code) UnityEditor.Android.PostProcessAndroidPlayer:PostProcess (UnityEditor.BuildTarget,string,string,string,string,string,string,UnityEditor.BuildOptions,UnityEditor.RuntimeClassRegistry,UnityEditor.Build.Reporting.BuildReport) 0x0000000052EB613A (Mono JIT Code) UnityEditor.Android.AndroidBuildPostprocessor:PostProcess (UnityEditor.Modules.BuildPostProcessArgs,UnityEditor.BuildProperties&) 0x0000000052EB5822 (Mono JIT Code) [PostprocessBuildPlayer.cs:285] UnityEditor.PostprocessBuildPlayer:Postprocess (UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,string,string,string,int,int,UnityEditor.BuildOptions,UnityEditor.RuntimeClassRegistry,UnityEditor.Build.Reporting.BuildReport) 0x0000000052EB5C6E (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_int_object_object_object_int_int_int_object_object (object,intptr,intptr,intptr) 0x00007FF8C318668F (mono) [mini.c:4937] mono_jit_runtime_invoke 0x00007FF8C30D8A95 (mono) [object.c:2623] mono_runtime_invoke 0x0000000140BDDC2A (Unity) scripting_method_invoke 0x0000000140BD67F0 (Unity) ScriptingInvocation::Invoke 0x0000000140D5A82F (Unity) CallMono 0x0000000140D653E0 (Unity) PostprocessPlayer 0x0000000140D5DC29 (Unity) DoBuildPlayer_PostBuild 0x0000000140D5D3CC (Unity) DoBuildPlayer 0x0000000140D50787 (Unity) BuildPlayer 0x00000001415164A0 (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck 0x000000004BE317E7 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,bool) 0x000000004BE30E30 (Mono JIT Code) [BuildPlayerWindowBuildMethods.cs:165] UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions) 0x000000004BE2D48B (Mono JIT Code) [BuildPlayerWindowBuildMethods.cs:89] UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions) 0x000000004BE2CDEC (Mono JIT Code) [BuildPlayerWindow.cs:181] UnityEditor.BuildPlayerWindow:BuildPlayerAndRun (bool) 0x000000004BE2C98C (Mono JIT Code) [BuildPlayerWindow.cs:175] UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () 0x00000000008F11DE (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) 0x00007FF8C318668F (mono) [mini.c:4937] mono_jit_runtime_invoke 0x00007FF8C30D8A95 (mono) [object.c:2623] mono_runtime_invoke 0x0000000140BD4CF7 (Unity) CallStaticMonoMethod 0x0000000140BD4A7E (Unity) CallStaticMonoMethod 0x0000000140D5732F (Unity) BuildPlayerWithLastSettings 0x00000001415B8EC1 (Unity) ResourceDrivenMenus::Execute 0x000000014133EDC8 (Unity) MenuController::ExecuteMenuItem 0x00000001415C49E5 (Unity) ProcessMainWindowMessages 0x00000001415A1DF5 (Unity) ContainerWindow::ContainerWndProc 0x00007FF8EE2B6CC1 (USER32) CallWindowProcW 0x00007FF8EE2B6693 (USER32) DispatchMessageW 0x00000001415C4261 (Unity) MainMessageLoop 0x00000001415C65DC (Unity) WinMain 0x000000014271FDA7 (Unity) __scrt_common_main_seh 0x00007FF8EE913034 (KERNEL32) BaseThreadInitThunk 0x00007FF8EF361431 (ntdll) RtlUserThreadStart

编辑:附加堆栈跟踪

CommandInvokationFailure: Unable to merge android manifests.  C:/Program Files/Java/jdk1.8.0_172\bin\java.exe -Xmx2048M
-Dcom.android.sdkmanager.toolsdir="E:/AndroidSDK\tools" -Dfile.encoding=UTF8 -jar "E:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar"
-

stderr[ Error: [Temp\StagingArea\AndroidManifest-main.xml, E:\path\Temp\StagingArea\android-libraries\com.google.firebase.firebase-measurement-connector-impl-16.0.0\AndroidManifest.xml:10] Trying to merge incompatible /manifest/application/service[@name=com.google.firebase.components.ComponentDiscoveryService] element: <service
@android:name="com.google.firebase.components.ComponentDiscoveryService">
<meta-data
-- @android:name="com.google.firebase.components:com.google.firebase.iid.Registrar" <service
@android:name="com.google.firebase.components.ComponentDiscoveryService">
<meta-data
++ @android:name="com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar" ] stdout[ [Temp\StagingArea\AndroidManifest-main.xml, E:\path\Temp\StagingArea\android-libraries\com.android.support.support-core-ui-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element. [Temp\StagingArea\AndroidManifest-main.xml, E:\path\Temp\StagingArea\android-libraries\com.android.support.support-core-utils-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element. [Temp\StagingArea\AndroidManifest-main.xml, E:\path\Temp\StagingArea\android-libraries\com.android.support.support-fragment-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element. [Temp\StagingArea\AndroidManifest-main.xml, E:\path\Temp\StagingArea\android-libraries\com.android.support.support-media-compat-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element. [Temp\StagingArea\AndroidManifest-main.xml, E:\path\Temp\StagingArea\android-libraries\com.android.support.support-v4-26.1.0\AndroidManifest.xml:6] Skipping identical /manifest/application/meta-data[@name=android.support.VERSION] element. [Temp\StagingArea\AndroidManifest-main.xml, E:\path\Temp\StagingArea\android-libraries\com.google.firebase.firebase-analytics-impl-16.0.0\AndroidManifest.xml:15] Skipping identical /manifest/application/service[@name=com.google.android.gms.measurement.AppMeasurementService] element. [Temp\StagingArea\AndroidManifest-main.xml, E:\path\Temp\StagingArea\android-libraries\com.google.firebase.firebase-analytics-impl-16.0.0\AndroidManifest.xml:12] Skipping identical /manifest/application/receiver[@name=com.google.android.gms.measurement.AppMeasurementReceiver] element. ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommand (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

我查看了所有的 android list 并在

中找到了两个相同的声明

E:\path\Temp\StagingArea\android-libraries\com.google.firebase.firebase-iid-16.0.0\AndroidManifest.xml

<service android:name="com.google.firebase.components.ComponentDiscoveryService" >
<meta-data
android:name="com.google.firebase.components:com.google.firebase.iid.Registrar"
android:value="com.google.firebase.components.ComponentRegistrar" />
</service>

E:\path\Temp\StagingArea\android-libraries\com.google.firebase.firebase-measurement-connector-impl-16.0.0\AndroidManifest.xml

<service android:name="com.google.firebase.components.ComponentDiscoveryService" >
<meta-data
android:name="com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar"
android:value="com.google.firebase.components.ComponentRegistrar" />
</service>

有没有办法自己解决这个问题,是我遗漏了什么还是这是一个 firebase 错误?

最佳答案

我找到了

<service android:name="com.google.firebase.components.ComponentDiscoveryService" >

在3个aar文件中,你可以在图片中看到here

我将上面的所有服务标签合并到一个 android list 文件中,并在其他 like this 中删除然后unity就可以build APK ok了。我使用 Unity 5.6.4p3 和 Firebase 实时数据库 SDK 5.0.0

我希望这可以帮助别人,抱歉我的英语不好。

关于android - AndroidManifest 中的多个 ComponentDiscoveryService --> 合并冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50841255/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com