Unity无法使用Facebook SDK构建Android [英] Unity Can't build android with facebook sdk

查看:136
本文介绍了Unity无法使用Facebook SDK构建Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将Facebook SDK(v7.10.1)添加到了我的Unity项目中,我在那里也拥有Gamespark SDK.

I have added the Facebook SDK (v7.10.1) to my Unity project, where I have the Gamespark SDK, too.

构建游戏时,我收到重新包装错误.

When I build the game I get a re-package error.

有人知道出了什么问题吗?

Anyone a idea what's the problem?

CommandInvokationFailure: Failed to re-package resources.
D:\Programmieren\Zubehör\Android SDK\build-tools\25.0.2\aapt.exe package --
auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I 
"D:/Programmieren/Zubehör/Android SDK\platforms\android-26\android.jar" -F 
bin/resources.ap_ --extra-packages com.facebook:com.facebook.android -S 
"E:\Programmieren\C#\workspaces\Ice Slider\Unity3d\Ice 
Slider\Temp\StagingArea\android-libraries\facebook-android-sdk-4.23.0\res" -
S "E:\Programmieren\C#\workspaces\Ice Slider\Unity3d\Ice 
Slider\Temp\StagingArea\android-libraries\facebook-android-wrapper-
7.10.1\res"

stderr[
E:\Programmieren\C#\workspaces\Ice Slider\Unity3d\Ice             
Slider\Temp\StagingArea\android-libraries\facebook-android-sdk-
4.23.0\res\values\values.xml:131: error: Error retrieving parent for item: 
No resource found that matches the given name 
'@style/Theme.AppCompat.NoActionBar'.

E:\Programmieren\C#\workspaces\Ice Slider\Unity3d\Ice 
Slider\Temp\StagingArea\android-libraries\facebook-android-sdk-
4.23.0\res\values\values.xml:136: error: Error retrieving parent for item: 
No resource found that matches the given name 
'@style/Theme.AppCompat.Dialog'.

]
stdout[
Configurations:
 (default)

Files: 
  AndroidManifest.xml
    Src: () AndroidManifest.xml

推荐答案

我找到了解决此问题的方法. 这里有几个步骤:

I got the solution for this problem. Here are few steps to do:

  1. 删除Facebook SDK文件夹.
  2. 删除PlayServicesResolver文件夹.
  3. 删除插件文件夹.
  4. 现在使用Facebook API和名称空间注释代码.
  5. 现在导入FacebookSDK 7.10.0,并在编辑设置"选项中使用项目详细信息对其进行配置.
  6. 现在重新生成Android Manifest文件并取消注释代码.

现在您可以为您的项目成功构建Apk.

Now you can successfully build Apk for your project.

这篇关于Unity无法使用Facebook SDK构建Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆