简体   繁体   English

Facebook和Google Play服务出现统一错误

[英]Facebook and Google Play services on unity Error

I have been trying to resolve an error in Unity and can't get it to work at all. 我一直在尝试解决Unity中的一个错误,根本无法使其正常工作。

I have Admob and Google Play services installed and by themselves everything is okay; 我已经安装了Admob和Google Play服务,而且一切正常。 as soon as I add Facebook SDK this is the error I get. 一旦添加Facebook SDK,这就是我得到的错误。 I try deleting one of the conflicts and none of them work when deleted. 我尝试删除其中一种冲突,并且删除后它们均无法正常工作。 Does anyone know a fix? 有人知道解决方法吗?

 Found conflicting Android library gpgs-plugin-support

Assets/Plugins/Android/gpgs-plugin-support-0.9.42 (managed by the Android Resolver) conflicts with:
Assets/GooglePlayGames/Editor/m2repository/com/google/games/gpgs-plugin-support/0.9.42/gpgs-plugin-support-0.9.42.aar

Your application is unlikely to build in the current state.

To resolve this problem you can try one of the following:
* Updating the dependencies managed by the Android Resolver
  to remove references to old libraries.  Be careful to not
  include conflicting versions of Google Play services.
* Contacting the plugin vendor(s) with conflicting
  dependencies and asking them to update their plugin.

UnityEngine.Debug:LogWarning(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.ResolverVer1_1:FindAndResolveConflicts()
GooglePlayServices.<DoResolution>c__AnonStorey17:<>m__29()
GooglePlayServices.<DoResolutionUnsafe>c__AnonStorey18:<>m__26(List`1)
GooglePlayServices.<GradleResolution>c__AnonStorey14:<>m__1F(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey15:<>m__28()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

There is a tool provided by Google which called Google Play Services Jar Resolver, and you should use it to resolve these conflicts. Google提供了一个名为Google Play Services Jar Resolver的工具,您应该使用它来解决这些冲突。 The latest Facebook SDK (7.10.1) already contains resolver when imported from unitypackage file. 从unitypackage文件导入时,最新的Facebook SDK(7.10.1)已包含解析器。

After importing the package, you can resolve client jars in the Unity Editor menu bar, under Assets > Play Services Resolver > Android Resolver. 导入软件包后,您可以在Unity编辑器菜单栏中的Assets> Play Services Resolver> Android Resolver下解析客户端jar。

If it doesn't work for you, you can also get detailed info from github page of jar resolver. 如果它不适合您,您还可以从jar解析器的github页面获取详细信息。

The workaround is to rename Assets/GooglePlayGames/Editor/m2repository/com/google/games/gpgs-plugin-support/0.9.42/gpgs-plugin-support-0.9.42.aar to Assets/GooglePlayGames/Editor/m2repository/com/google/games/gpgs-plugin-support/0.9.42/gpgs-plugin-support-0.9.42. 解决方法是将Assets/GooglePlayGames/Editor/m2repository/com/google/games/gpgs-plugin-support/0.9.42/gpgs-plugin-support-0.9.42.aar为Assets / GooglePlayGames / Editor / m2repository / com /google/games/gpgs-plugin-support/0.9.42/gpgs-plugin-support-0.9.42。 srcaar 斯卡

and edit Assets/GooglePlayGames/Editor/m2repository/com/google/games/gpgs-plugin-support/0.9.42/gpgs-plugin-support-0.9.42.pom and add 并编辑Assets / GooglePlayGames / Editor / m2repository / com / google / games / gpgs-plugin-support / 0.9.42 / gpgs-plugin-support-0.9.42.pom并添加

<packaging>srcaar</packaging> right under the <version> line. <packaging>srcaar</packaging>就在<version>行下面。

Then delete Assets/Plugins/Android/gpgs-plugin-support-0.9.42 and re-run the Jar resolver. 然后删除Assets/Plugins/Android/gpgs-plugin-support-0.9.42并重新运行Jar解析器。

Try this solutions ! 试试这个解决方案! Works with latest plugin versions ! 适用于最新的插件版本!

Resolution for Dex issues on adding Google Play Services 0.95 and Facebook sdk 7.13.0 plugins to Unity 2018.2.0f2 解决在Unity 2018.2.0f2中添加Google Play Services 0.95和Facebook sdk 7.13.0插件的Dex问题的解决方案

Step 1: First import GooglePlayServices0.95 plugin from this link https://github.com/playgameservices/play-games-plugin-for-unity . 步骤1:首先从此链接https://github.com/playgameservices/play-games-plugin-for-unity导入GooglePlayServices0.95插件。

Step 2: Un Check PlayServicesResolver folder when showed folder structure to import. 步骤2:当显示要导入的文件夹结构时,取消选中PlayServicesResolver文件夹。

Step 3: Now Import Facebook SDK 7.13.0 unity package from https://developers.facebook.com/docs/unity/downloads/ 步骤3:现在从https://developers.facebook.com/docs/unity/downloads/导入Facebook SDK 7.13.0统一软件包。

Step 4: Here import all folders of the facebook sdk plugin. 步骤4:在这里导入facebook sdk插件的所有文件夹。

Step 5: Now select Assets/PlayServicesResolver/VersionHandler/Update 步骤5:现在选择Assets / PlayServicesResolver / VersionHandler / Update

Step 6: Now select Assets/PlayServicesResolver/AndroidResolver/Resolve 步骤6:现在选择Assets / PlayServicesResolver / AndroidResolver / Resolve

Step 7: Now select Assets/PlayServicesResolver/AndroidResolver/Settings and then uncheck Enable Auto-Resolution 步骤7:现在选择Assets / PlayServicesResolver / AndroidResolver / Settings,然后取消选中Enable Auto-Resolution

Step 8: Now go to Project Panel and go to Assets/Plugins/Android/ and delete all folders except folder with this name "com.google.games.gpgs-plugin-support-0.9.50" 步骤8:现在转到项目面板,转到Assets / Plugins / Android /并删除除名称为“ com.google.games.gpgs-plugin-support-0.9.50”的文件夹以外的所有文件夹

Step 9: Now go to Project Panel and go to Assets/Plugins/Android/ and delete the following files 步骤9:现在转到项目面板,转到Assets / Plugins / Android /并删除以下文件

com.android.support.animated-vector-drawable-25.3.1
com.android.support.customtabs-25.3.1
com.android.support.support-annotations-25.3.1
com.android.support.support-v4-25.3.1
com.android.support.support-vector-drawable-25.3.1

Now proceed with build making. 现在继续进行构建。 It should work. 它应该工作。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM