2

I know that there are a lot of similar questions, but I cannot really fix it. I've lost a week and I'm still at square one.

I'm trying to export a very basic app that perform a login on Facebook. The code is the same code as in the sample. It works in debug but exporting it returns the error Dalvik format failed with error 1

If I remove the reference and create a blank app, everything works. If I add the reference to the Facebook sdk, it chrashes. I've checked my references, paths, cleaned all, rebooted the machine. Nothing works! I'm not using proguard. I've installed Java 6. I'm on win 8 64 bit.

dandan78
  • 13,328
  • 13
  • 64
  • 78
Davide.77
  • 165
  • 2
  • 12
  • Basically you have to check for two or more JAR files on your buildpath that include the same package and classes - this will cause this error. – Pratik Sharma Jan 04 '13 at 16:03
  • thanks for the response but.... I'm really new to android and java. Where I have to search? I think that issue is about android-support-v4.jar but is present only in facebook sdk.. – Davide.77 Jan 04 '13 at 16:23

3 Answers3

16

My problem was solved by doing this :

Uncheck Project -> Build Automatically

Now export your apk. It should work without any problem.

Vipul Purohit
  • 9,807
  • 6
  • 53
  • 76
0

See "Conversion to Dalvik format failed with error 1" on external JAR

Go to Project » Properties » Java Build Path » Libraries and remove all except the "Android X.Y" (in my case Android 1.5). click OK. Go to Project » Clean » Clean projects selected below » select your project and click OK. That should work.

If this does not help try to update your Android tools (Help --> Check for Updates) or simply download a new copy of Eclipse and install the Android SDK again.

I faced this problem ones and I had to reinstall android-sdks

Community
  • 1
  • 1
ObAt
  • 2,337
  • 3
  • 24
  • 44
0

I was having this problem too with an app that used Facebook SDK. I was trying all sorts of stuff, so I'm not sure what exactly fixed but here's settings that worked for me:

FacebookSDK > Properties > Java Build Path > Order and Export

Android 2.2 - NOT CHECKED

Android Private Libraries - CHECKED

Android Dependencies - CHECKED

MyApp > Properties > Java Build Path > Order and Export

Android 4.2.2 - CHECKED

Android Private Libraries - CHECKED

Android Dependencies - CHECKED

In addition, I had done this before, not sure it mattered. Reverted to Facebook SDK version 3.5 from 3.5.2. Updated to latest ADT 22.2.1. Changed Facebook SDK to use Android 2.2 from 4.2.2.

Tom Kincaid
  • 4,887
  • 6
  • 47
  • 72