无法找到依赖项com.google.android.gms:play-services-ads-lite:[10.2.4]

时间:2017-05-03 09:21:29

标签: android firebase google-play-services unity5 firebase-analytics

我将Firebase Analytics导入到我的Unity项目中。我在Android SDK Manager中更新了几个软件包中的Google Play服务。当我尝试编译Unity项目时,出现以下错误:

1)

Unable to find dependency com.google.android.gms:play-services-ads-lite:[10.2.4] in paths ($SDK\extras\android\m2repository, $SDK\extras\google\m2repository, $SDK\extras\android\m2repository, $SDK\extras\google\m2repository).

com.google.android.gms:play-services-ads-lite:[10.2.4] was referenced by:
   at System.Environment.get_StackTrace() in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Environment.cs:line 227
   at Google.JarResolver.Dependency..ctor(System.String group, System.String artifact, System.String version, System.String[] packageIds, System.String[] repositories)
   at Google.JarResolver.PlayServicesSupport.GetDependencies(Google.JarResolver.Dependency dep, System.Collections.Generic.List`1 repoPaths)
   at Google.JarResolver.PlayServicesSupport.GetTransitiveDependencies(System.Collections.Generic.Dictionary`2 dependencies, System.Collections.Generic.List`1 repoPaths)
   at Google.JarResolver.PlayServicesSupport.FindMissingDependencyPaths(System.String destinationDirectory, System.Collections.Generic.Dictionary`2 ByRef dependencyPaths, Google.JarResolver.ExplodeAar explodeAar)
   at GooglePlayServices.ResolverVer1_1.DoResolution(Google.JarResolver.PlayServicesSupport svcSupport, System.String destinationDirectory, Google.JarResolver.OverwriteConfirmation handleOverwriteConfirmation, System.Action resolutionComplete)
   at GooglePlayServices.PlayServicesResolver.Resolve(System.Action resolutionComplete)
   at GooglePlayServices.PlayServicesResolver.AutoResolve()
   at UnityEditor.EditorApplication.Internal_CallUpdateFunctions() in C:\buildslave\unity\build\artifacts\generated\common\editor\EditorApplicationBindings.gen.cs:line 197

UnityEngine.Debug:LogError(Object)
GooglePlayServices.PlayServicesResolver:<PlayServicesResolver>m__0(String, LogLevel)
Google.JarResolver.PlayServicesSupport:Log(String, LogLevel, Boolean)
Google.JarResolver.PlayServicesSupport:FindCandidate(Dependency, List`1)
Google.JarResolver.PlayServicesSupport:GetDependencies(Dependency, List`1)
Google.JarResolver.PlayServicesSupport:GetTransitiveDependencies(Dictionary`2, List`1)
Google.JarResolver.PlayServicesSupport:FindMissingDependencyPaths(String, Dictionary`2&, ExplodeAar)
GooglePlayServices.ResolverVer1_1:DoResolution(PlayServicesSupport, String, OverwriteConfirmation, Action)
GooglePlayServices.PlayServicesResolver:Resolve(Action)
GooglePlayServices.PlayServicesResolver:AutoResolve()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

2)

ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-ads-lite:[10.2.4]
Google.JarResolver.PlayServicesSupport.GetDependencies (Google.JarResolver.Dependency dep, System.Collections.Generic.List`1 repoPaths)
Google.JarResolver.PlayServicesSupport.GetTransitiveDependencies (System.Collections.Generic.Dictionary`2 dependencies, System.Collections.Generic.List`1 repoPaths)
Google.JarResolver.PlayServicesSupport.FindMissingDependencyPaths (System.String destinationDirectory, System.Collections.Generic.Dictionary`2& dependencyPaths, Google.JarResolver.ExplodeAar explodeAar)
GooglePlayServices.ResolverVer1_1.DoResolution (Google.JarResolver.PlayServicesSupport svcSupport, System.String destinationDirectory, Google.JarResolver.OverwriteConfirmation handleOverwriteConfirmation, System.Action resolutionComplete)
GooglePlayServices.PlayServicesResolver.Resolve (System.Action resolutionComplete)
GooglePlayServices.PlayServicesResolver.AutoResolve ()
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:197)

当我去Assets时,我遇到了同样的错误&gt;播放服务解析器&gt; Android解析器&gt;解析客户端罐子。

我该怎么做才能消除错误?

1 个答案:

答案 0 :(得分:0)

我想我解决了它。

转到项目Assets / GooglePlayGames / PluginVersion.cs中的文件, 在内部将PlayServicesVersionConstraint更改为&#34; 10.2.1&#34; (默认值为&#34; 10 +&#34;)。

拯救并团结。

在菜单中转到资产&gt;播放服务解析器&gt; Android解析器&gt;解决客户Jar。如果程序询问您有关更改版本的信息,请按ok。 应用程序应该可以工作。

PS:对不起我的英文,太糟糕了:(。