how to fix the following error for facebook android sdk integration using Phonegap

不羁的心 提交于 2019-12-08 02:48:03

问题


Please help to fix the following error. Currently trying to integrate Facebook Android SDK using PhoneGap.I have followed this tutorial:http://www.youtube.com/watch?v=mlpBgWiel2w and github resources:https://github.com/davejohnson/phonegap-plugin-facebook-connect.git But got the bellow error:-

   Error in an XML file: aborting build.
   Error in an XML file: aborting build.
   Dex Loader] Unable to execute dex: Multiple dex files define Lcom/facebook/android/AsyncFacebookRunner$1;
   Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/facebook/android/AsyncFacebookRunner$1;
   Unable to execute dex: Multiple dex files define Lcom/facebook/android/AsyncFacebookRunner$1;
    Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/facebook/android/AsyncFacebookRunner$1;
   Unable to execute dex: Multiple dex files define Lcom/facebook/android/AsyncFacebookRunner$1;
    Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/facebook/android/AsyncFacebookRunner$1;

回答1:


I had the same problem in eclipse and I did the following and it worked for me:

1- Right click your Android project
2- Properties >>> Java Build Path
3- Click on Android Dependencies
4- Click Remove >>> OK
5- Run Android project




回答2:


Its is a very easy fix though it seems to be very tough issue to solve.

1.Just make a copy of the project.
2.run the the copy of the project thats it!!!

As this steps worked for me




回答3:


I had this problem but may have resolved it. In platforms/android, run:

find . -name "AsyncFacebookRunner.class"

For me, this found the class in both platforms/android/ant-build/ and platforms/android/FacebookLib/ant-build. Since there will be a jar from FacebookLib, the class will end up multiple times. I managed to resolve this by making sure that Eclipse is closed and then removing all bin, gen, ant-build, and ant-gen directories from both platforms/android and platforms/android/FacebookLib and platforms/android/CordovaLib and then running the build command again. After that, the above find command only found one copy of the class, in FacebookLib/ant-build.



来源:https://stackoverflow.com/questions/14825086/how-to-fix-the-following-error-for-facebook-android-sdk-integration-using-phoneg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!