Android的SDK 2007-06-18实+ SDK不会建在Android的工作室 [英] Android AddThis sdk + Facebook sdk won't build in Android Studio

查看:219
本文介绍了Android的SDK 2007-06-18实+ SDK不会建在Android的工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,我Android Studio中工作,目前使用Facebook的SDK用于检索有关Facebook的用户的一些信息。它的工作原理pretty很好。

I have a project I'm working on in Android Studio that currently uses the Facebook SDK for retrieving some information about a Facebook user. It works pretty well.

我还需要实现2007-06-18,但是当我尝试编译这个项目同时参照的SDK,我得到的错误:

I also need to implement AddThis, however when I try to compile this project with both SDKs referenced, I get the error:

Android Dex: [<removed>] com.android.dx.util.DexException: Multiple dex files define Lcom/facebook/android/AsyncFacebookRunner$1;

在2007-06-18的.jar,符合市场预期,com.facebook.android.AsyncFacebookRunner存在。显然,它也存在着Facebook的SDK模块中。有功能,我需要在不实中存在2007-06-18,反之亦然。

Inside the AddThis .jar, as expected, com.facebook.android.AsyncFacebookRunner exists. Obviously it also exists in the Facebook SDK module. There is functionality that I need in AddThis that doesn't exist in Facebook, and vice versa.

有谁知道一种方法来处理这​​种情况?

Does anyone know a way to handle this type of situation?

推荐答案

我是能够解决这个问题:

I was able to resolve this issue:

由于Facebook的SDK是一个模块,而不是一个罐子,我引用AddThis0.8.8.jar从Facebook的SDK模块,并直接从我的项目中删除对它的引用。

Since the Facebook SDK is a module and not a jar, I referenced AddThis0.8.8.jar from the Facebook SDK module, and removed the reference to it from my project directly.

这样做之后,仍有com.facebook.android之间的冲突。*在Facebook的SDK,并在2007-06-18罐子重复(com.facebook.android。*)。所以,我删除了com.facebook.android包连同它的内容 - 来自Facebook的SDK - ?然后包括在(类路径​​,我觉得Android的com.addthis工作室建议,包括它的时候我输入ATButton在code。我说:哎呀啊,谢谢JetBrains的!)。

After doing so, there was still a conflict between com.facebook.android.* in the Facebook SDK and the duplicate ( com.facebook.android.* ) in the AddThis jar. So, I deleted the com.facebook.android package along with it's contents - from the Facebook SDK - then included com.addthis in ( class path, I think? Android Studio suggested to include it when I typed "ATButton" in code. I said "Heck yea, thanks JetBrains!" ).

我现在能够使用2007-06-18以及Facebook的SDK没有任何冲突。

I am now able to use AddThis as well as the Facebook SDK without any conflicts.

我希望这个过程能帮助人在那里以某种方式。

I hope this process can help someone out there in some way.

仍然有这个问题。我恢复了Facebook的SDK,并从2007-06-18罐中取出Facebook的东西。不是100%的工作仍在,但可能是一个更好的主意,让所有Facebook的东西,Facebook的模块中。请做,如果你有一个更好的解决方案张贴一个答案。

There were still problems with this. I reverted the Facebook SDK, and removed the Facebook stuff from the AddThis jar. Not 100% working still, but probably a better idea to keep all Facebook stuff in the Facebook module. Please do post an answer if you have a better solution.

这篇关于Android的SDK 2007-06-18实+ SDK不会建在Android的工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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