Robert
Robert

Reputation: 1726

Eclipse - ACRA jar file not recognised

I'm trying to add ACRA to my project and I've followed these steps ACRA Basic Setup but Eclipse is not recognising the @ReportCrashes that it has you create with the class:

enter image description here

I made sure I created a "lib" folder and I added the jar file to it (by drag & drop from a windows explorer), I then right-clicked it and choose Add to Build Path. I even tried to remove the jar file and re-add it and do a Project --> Clean but still nothing.

Any ideas as to what I'm doing wrong?

Here's some screenshots of the Annotations from Eclipse:

enter image description here

enter image description here

Upvotes: 1

Views: 849

Answers (3)

fishjd
fishjd

Reputation: 1687

Robert,

I updated to R20 of the Android SDK Tools today (Aug 15, 2012) and also upgraded to Eclipse Juno and had similar problems with ACRA and my other jar files.

The way I understand it R17 change the build process that any jar in the '/libs' folder is automatically added to the build path. Which means if you had a jar in the '/libs' folder you need to remove it from you java build path or you get the dreaded "Dalvik 1" build error.

Next, I noticed there is no way to add source or javadoc to jars in the lib folder. So I moved all my jars to a second folder, in my case '/external/jar'. When I moved ACRA-4.2.3.jar to '/external/jar' my project would crash with the same error as yours. So I moved it back to '/libs' and it worked, although I could not add javadoc or source to the ACRA jar.

The conclusion is to place the ACRA jar file in the '/libs' folder. Other jar files may be placed in '/libs' or elsewhere. Also, update Android SDK and Eclipse.

Hope this helps you are somebody,

Fish

Upvotes: 1

androidu
androidu

Reputation: 4728

OK I figured out the problem. I had the same issue as you and the problem for me was that I added the source jar and not the build jar from the ACRA archive. It now recognizes the classes from the jar. Rookie mistake :)

Upvotes: 2

Frank
Frank

Reputation: 2847

I've had the same problem, and I think I've discovered the root of it: I was importing the jar inside SRC folder, instead of importing the one in BUILD folder. Just deleted the first one, reconfigured BUILDPATH to remove the wrong entry, did a clean, copied the right (BUILD FOLDER) jar into the libs folder in my project and then everything went OK

Maybe it helps?

Upvotes: 3

Related Questions