The moment I added the android support annotations to my dependencies
compile \'com.android.support:support-annotations:20.0.0\'
I got this erro
Updating Android SDK Tools fixed it for me, now it just sees the copy in android-support-v4.jar
.
I had the same problem when using ant, and the annotations library was being included automatically by an outdated sdk.dir/tools/ant/build.xml
.
Clean project works as a temporary fix, but the issue will reappear on next compilation error.
To fix more reliably, I had to update the dependency to android support-v4
to com.android.support:support-v4:22.2.0
.
Put in your build.gradle the dependency of support-annotations according with your compileSdkVersion. For instance: A project with the compileSdkVersion 25 you can put the following dependence:
compile 'com.android.support:support-annotations:25.0.1'
This will solve your problem.
I had the same problem , but i deleted build files from the build folder
projectname/app/build
and it removed all the related error. "can't clean the project" and also "dex errow with $anim"
Put android-support-v4.jar in your libs folder in eclipse. Clean and build the project. It will resolve the issue.
If this is cordova / ionic project this worked for me
add these line to build.gradle under platforms/android after line number 22 i.e after apply plugin: 'android'
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}