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;
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
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
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