When attempting to use the latest appcompat-v7 support library in my project, I get the following error:
/Users/greg/dev/mobile/android_project/app/build/int
What I recomend is: (This works to me after many days with errors)
-Make sure that you have downloaded:
- the Lastest SDK Platform from the latest Android version
- Android Suppor Librarie and Repository from EXTRAS
-Redowload the ADT
-Make a security copy of your project.
-You must have the ADT, the workspace and the project that we will import in the same disk (e.g. C:/)
Now delete the app compat and your project.
In eclipse: File > Import > Android existing project > Next > Browse (The folder where you have your ADT)/sdk/extras/android/v7/appcompat > Import > Finish
Now in the eclipse Package Explorer: android-support-v7-appcompat/libs/ Make on the two JARS: Right click > Build Path > Add to Build Path
Right click on libs/ folder > Buil Path > Configure Build Path and check this two JARS > OK
On the upper eclipse bar > Project > Clean
Import your project > File > Import > Browse your project > Finish
Now, Right click on the projectfile and android-support-v7-appcompat > Properties > Android > And select the latest API that appears > OK
Right click on the projectfile > Properties > Android > Add > android-support-v7-appcompat
On the upper eclipse bar > Project > Clean
My problem was that I had other libraries that my project referenced and those libraries had another version of appcompat referenced. This is what I did to resolve the issue:
(You should back up your project before doing this)
1) I deleted all the appcompat layout folders (ex: /res/layout-v11).
2) Solved the problems that arose from that, usually an error in menu.xml
3) Back to main project and add appcompat library, clean, and everything works!
In Android Studio I was trying to set the compileSdkVersion
and targetSdkVersion
to 19
.
My solution was to replace at the bottom of build.gradle
, from this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
To the older version of the appcompat library:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
}
This is likely because you haven't set your compileSdkVersion
to 21 in your build.gradle file. You also probably want to change your targetSdkVersion
to 21.
android {
//...
compileSdkVersion 21
defaultConfig {
targetSdkVersion 21
}
//...
}
This requires you to have downloaded the latest SDK updates to begin with.
Once you've downloaded all the updates (don't forget to also update the Android Support Library/Repository, too!) and updated your compileSdkVersion, re-sync your Gradle project.
Edit: For Eclipse or general IntelliJ users
See reVerse's answer. He has a very thorough walk through!
Upgrading to latest gradle plugin solve my problem :
classpath 'com.android.tools.build:gradle:0.13.+'
`Follow below steps:
its working for me.To resolve this issue,
1.Right Click on appcompat_v7 library and select Properties
2.Now, Click on Android Option, Set Project Build Path as Android 5.0 (API level 21) Apply Changes.
3.Now go to project.properties file under appcompat_v7 library,
4.Set the project target as : target=android-21
5.Now Clean + Build appcompat_v7 library and your projects`