Unity自动构建中的Google PlayResolver

时间:2018-01-09 15:04:50

标签: android firebase unity3d build

我有一个包含我的游戏的存储库,里面是从.unitypackage导入的firebase消息传递和分析SDK但是我没有安装Android依赖项(Play解析器下载我想用gradle)。

因此,在使用统一编辑器的正常流程中,播放解析器将下载所需的依赖项并将它们放入我的项目中。如果我建立一切正常。

问题在于自动构建,我们通过命令行执行自定义构建管道调用unity。在这种情况下,没有下载Android依赖项(没有触发游戏解析器下载),因此Unity创建没有这些依赖项的apk,当我尝试打开应用程序时崩溃,因为它里面没有一些AndroidManifest代码。

修改

在我的管道中,我有一个运行此代码的预处理脚本

PlayServicesResolver.Resolve(continuePipeline, true, b => Debug.Log("Success: " + b));

如果我从统一编辑器中的MenuItem运行我的管道,构建成功下载依赖项并创建apk但是当我运行Unity关闭的命令时,该过程将打开Unity尝试解析依赖关系但它会杀死批处理模式并停止管道。

DependOn - group: com.google.firebase artifact: firebase-messaging-unity version: 4.3.0 packageIds:  repositories: Assets/Firebase/m2repository
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:LogDelegate(String, LogLevel)
Google.JarResolver.PlayServicesSupport:Log(String, LogLevel, Boolean)
Google.JarResolver.PlayServicesSupport:DependOn(String, String, String, String[], String[], String)
GooglePlayServices.<Read>c__AnonStoreyC:<>m__E(XmlTextReader, String, Boolean, String, List`1)
Google.XmlUtilities:ParseXmlTextFileElements(String, Logger, ParseElement)
GooglePlayServices.AndroidXmlDependencies:Read(String, Logger)
GooglePlayServices.XmlDependencies:ReadAll(Logger)
GooglePlayServices.AndroidXmlDependencies:ReadAll(Logger)
GooglePlayServices.PlayServicesResolver:ResolveUnsafe(Action`1, Boolean)
GooglePlayServices.<Resolve>c__AnonStorey11:<>m__19()
GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob()
GooglePlayServices.PlayServicesResolver:Resolve(Action, Boolean, Action`1)
BuilderPreProccess:Run(BuildType, BuildTarget, Action) (at Assets/Editor/BuilderPreProccess.cs:10)
Etermax.CI.Builder:BuildPreProccess(BuildTarget, BuildType, Action) (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/Builder.cs:158)
Etermax.CI.Builder:RunPreProccess(BuildType, BuildTarget, Action) (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/Builder.cs:47)
Etermax.CI.ProjectBuilders:CIBuildQA() (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/ProjectBuilders.cs:69)

(Filename: Assets/Editor/BuilderPreProccess.cs Line: 10)

Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.224102 seconds (Nothing changed)
Resolving...
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:ResolveUnsafe(Action`1, Boolean)
GooglePlayServices.<Resolve>c__AnonStorey11:<>m__19()
GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob()
GooglePlayServices.PlayServicesResolver:Resolve(Action, Boolean, Action`1)
BuilderPreProccess:Run(BuildType, BuildTarget, Action) (at Assets/Editor/BuilderPreProccess.cs:10)
Etermax.CI.Builder:BuildPreProccess(BuildTarget, BuildType, Action) (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/Builder.cs:158)
Etermax.CI.Builder:RunPreProccess(BuildType, BuildTarget, Action) (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/Builder.cs:47)
Etermax.CI.ProjectBuilders:CIBuildQA() (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/ProjectBuilders.cs:69)

(Filename: Assets/Editor/BuilderPreProccess.cs Line: 10)

Query Android SDK packages

/Users/martin/Library/Android/sdk/tools/bin/sdkmanager --list --verbose

UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.SdkManagerUtil:QueryPackages(String, String, Action`1)
GooglePlayServices.SdkManager:QueryPackages(Action`1)
GooglePlayServices.<DoResolution>c__AnonStorey10:<>m__16(IAndroidSdkManager)
GooglePlayServices.AndroidSdkManager:Create(String, Action`1)
GooglePlayServices.GradlePreBuildResolver:DoResolution(PlayServicesSupport, String, Action)
GooglePlayServices.PlayServicesResolver:ResolveUnsafe(Action`1, Boolean)
GooglePlayServices.<Resolve>c__AnonStorey11:<>m__19()
GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob()
GooglePlayServices.PlayServicesResolver:Resolve(Action, Boolean, Action`1)
BuilderPreProccess:Run(BuildType, BuildTarget, Action) (at Assets/Editor/BuilderPreProccess.cs:10)
Etermax.CI.Builder:BuildPreProccess(BuildTarget, BuildType, Action) (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/Builder.cs:158)
Etermax.CI.Builder:RunPreProccess(BuildType, BuildTarget, Action) (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/Builder.cs:47)
Etermax.CI.ProjectBuilders:CIBuildQA() (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/ProjectBuilders.cs:69)

(Filename: Assets/Editor/BuilderPreProccess.cs Line: 10)

Executing command: /Users/martin/Library/Android/sdk/tools/bin/sdkmanager --list --verbose
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.CommandLineDialog:RunAsync(String, String, CompletionHandler, String, Dictionary`2, IOHandler, Int32)
GooglePlayServices.SdkManagerUtil:QueryPackages(String, String, Action`1)
GooglePlayServices.SdkManager:QueryPackages(Action`1)
GooglePlayServices.<DoResolution>c__AnonStorey10:<>m__16(IAndroidSdkManager)
GooglePlayServices.AndroidSdkManager:Create(String, Action`1)
GooglePlayServices.GradlePreBuildResolver:DoResolution(PlayServicesSupport, String, Action)
GooglePlayServices.PlayServicesResolver:ResolveUnsafe(Action`1, Boolean)
GooglePlayServices.<Resolve>c__AnonStorey11:<>m__19()
GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob()
GooglePlayServices.PlayServicesResolver:Resolve(Action, Boolean, Action`1)
BuilderPreProccess:Run(BuildType, BuildTarget, Action) (at Assets/Editor/BuilderPreProccess.cs:10)
Etermax.CI.Builder:BuildPreProccess(BuildTarget, BuildType, Action) (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/Builder.cs:158)
Etermax.CI.Builder:RunPreProccess(BuildType, BuildTarget, Action) (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/Builder.cs:47)
Etermax.CI.ProjectBuilders:CIBuildQA() (at Assets/Standard Assets/node_modules/@etermax/etermax-ci/Assets/Package/Editor/ProjectBuilders.cs:69)

(Filename: Assets/Editor/BuilderPreProccess.cs Line: 10)

Batchmode quit successfully invoked - shutting down!

0 个答案:

没有答案