2

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;
GrIsHu
  • 29,068
  • 10
  • 64
  • 102
Azad Sarker
  • 21
  • 1
  • 3

3 Answers3

6

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

Amt87
  • 5,493
  • 4
  • 32
  • 52
  • 1
    Did everything from all the other advises, your solution works :) thanks for Sharing – May Aug 05 '13 at 20:00
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

The Hungry Dictator
  • 3,444
  • 5
  • 37
  • 53
0

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.

levsa
  • 930
  • 9
  • 16