Reputation: 15740
I've seen that there are quite a few questions regarding this problem, but unfortunately none have solved it for me. Here is a screencap of what's going on:
It is dependent on the android-support-v4 jar file which as you can see is added to my build path. It the exact jar file from the maven library directory's libs folder. I've tried the following:
Nothing has helped. Is there any other tricks to getting this resolved? All of the answer's I've seen suggest doing these things that I have already tried.
Thanks a lot!
Upvotes: 1
Views: 1547
Reputation: 3785
Assuming you're using m2e-android behind the scenes, the reason you're getting compile problems is that the m2e-android plug-in strips out all provided
scope dependencies from the Eclipse project classpath.
We do this because, due to changes in ADT 16.0.0, any JAR file in the Eclipse classpath will be packaged into distributable APK file.
Upvotes: 0
Reputation: 1329092
Actual root cause:
The OP JMRboosties reports in this instance having to desactivate Proguard (the tool which shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names)
disabling proguard on the line where the error occurred (the
<plugin>
item) inpom.xml
solved the problem
(See "How to use ProGuard with android-maven-plugin ").
Certain side-effects can result from using Proguard: For example, the Proguard page does mention:
The default
proguard.cfg
file tries to cover general cases, but you might encounter exceptions such asClassNotFoundException
, which happens when ProGuard strips away an entire class that your application calls.
Original answer:
As mentioned in this GitHub post:
I'm going to deploy my own android artifacts to my personal repository to avoid having this problem again.
If you're not explicitly using Maven you can just import it as a regular Android project into eclipse and it'll pick up the.jar
from thelibs/
directory.
(Note your android-support-v4.jar
isn't in libs
in your project)
You have to install both Android 1.6 and the compat lib using the maven SDK deployer for now.
cd to
platforms/platform-4/
andextras/compatibility-v4/
in thedeployer
and runmvn install
in each.Hopefully the
compat
lib makes it into maven central soon so I can avoid this step.Again, the project is set up to be used as a normal Android project in eclipse too completely separate from maven.
File, New, Project, Android
, useexisting sources
, selectlibrary/
folder.
Upvotes: 1