android eclipse appcompatv7 error - android

Hi i have problem in creating a new project in eclipse. I have errors in both android support library and in my project. I tried removing the library project and added again as said by many websites. But Still end up with errors. Please guide me in this
SDK Screenshot

The issue is that the support library has updated definitions for Android 5.0 (Lollypop). Since resource folders such as values-v21 and layout-v21 have been defined in the support library, both your application and appcompat projects do not know API 21 since your build target is set for an older version of Android.
To resolve this, you need to make sure that both your application and the appcompat projects have the build target set to Android 5.0 since the support library has updated values for the new Material theme that has been backported. It is a good idea to always target the latest versions so that you don't run into these issues with future updates to the support library.
You can do this in Eclipse by:
Right-click the project folder and select Properties
Select Android on the side menu
Select Android 5.0 as the Project Build Target
You may need to download the Android 5.0 (API 21) SDK Platform in the SDK manager if you cannot find the Android 5.0 target.

Right click on appcompat project and change the build version to android-5.0.
You have appcompat library which is having values-v21.
So, change the build version of android from 4.4.2 to 5.0

Try these steps.
Delete the android-support-v7-appcompat project (from the workspace, leave it on the disk)
Delete the android-support-v7-appcompat project (from the workspace, leave it on the disk)
Go to your project and select Properties -> Android, and remove android-support-v7-appcompat from your references.
Perform clean
Re-import android-support-v7-appcompat.
Re-add appcompat as a reference for your project again.
Perform another clean of the project

Try to add the library via Right click project -> Android Tools -> Add Support Library

Related

support library in Eclipse vs AndroidStudio

I tried to build Eclipse project that references android.support.design library (CoordinatorLayout and FAB inside it). I copied into my workspace android.support.v7.recyclerview library project and sucesfuly built it. Then did the same with appcompat-v7. That enabled me to build design library (previously also copied into workspace) which goes OK. Finally I built project, that references design library. Everything went well, designer presented good preview (API23), but running on device (API 17) didn't succeed- LogCat express disability to inflate CoordinatorLayout. TargetSDK was 17 and compilerSDk was 23. My support library is 23.1 version.
When making the same project in Android Studio (everything was wizard generated), I faced no problems. I noticed the same dependencies in gradle file, and SDKs are same as in Eclipse. Why those diferencies and where did I go wrong ?
You mean you have problems on Eclipse but none in Android Studio? Try lowering the compilerSDk or raising the TargetSDK to the latest release.

container 'Android Dependencies' references non existing library '/workspace/appcompat_v7/bin/appcompat_v7.jar

First of all, i know this question has been asked a lot, but nothing seem to be working for me.I have installed Eclipse ADT On MAC 10.9.5 from android.developer.com and have installed latest Android SDK tools, and all other platform and tools required for Android 5.0, android 4.4W and Android 4.4.2. I have also installed Android support library. But when i try to run the project with the default properties,
http://postimg.org/image/4lf8ayl99/
Minimum Required : SDK-API8:Android 2.2(Froyo)
Target SDk-Android; 4.x(L Preview)
Compile With ; API 21: Android 4.x( L Preview)
It always give me error,
The container 'Android Dependencies' references non existing library '/Users/xxx/Documents/workspace/appcompat_v7/bin/appcompat_v7.jar'
I went through all the solutions listed on web and on this website too, but nothing worked for me.
appcompat_v7 library gets generated, and then i click on add to build path for android-support-v7-appcompat.jar and android-support-v4.jar, and then from build path add the two libraries and untick android dependencies and add the library to my project from android library. From other posts i get to know that after clean and build appcompat_v7 library project , appcompat_v7.jar would be generated in bin directory, but it doesn't happen in my case.
Please help. I have spent too much time looking for the solution, but didn't find any.
I finally found the solution, I had to update the jdk to 1.8, The jdk installed by default by eclipse ADT form android.developer.com doesn't seem to be updated and Since API 21 requires jdk 1.7 or above thus i had to install it from JDK official website http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html. Finally i got the support library appcompat_v7 working.
I had the same problem and I tried and after that message I got another from the res folder. Anyways what I did was switch work space and it worked fine . it should create those files for you as long as you downloaded the extras from android manager downloader.

Upgrading the SDK to a newer SDK

I have an app running on android 2.1 and I would like to update it to android 3.2 as I do not have anyone using that version. How do I go about doing that? I changed the min sdk in manifest but I was wondering about the JAR file. Do I download the jar for that version. Do I keep the old jar.
Thanks
Prerna
It doesn't matter what the Android version is of the jar file. That is only what target the application compiles with. If you want to change that, click on your project, File -> Properties -> Android and check the desired project build target (i.e. 3.2) and Apply.

How can I tell which Android Support Library v4 revision I use?

I can see in the Android SDK manager the version installed on my computer (in Android SDK manager), but usually a project uses its own copy from the libs folder.
Is there a way I can tell which version is the android-support-v4.jar being used in a specific project besides the file date?
Any method is considerable - by code / eclipse / file manager
in eclipse package explorer right click in your project
select android tools -> Add supported Library
there you see which supprt library revision id you have, in my case is 11
Take the md5 hash of the jar in your app's libs directory.
Compare it to the hashes of support library jar files to work out exactly which one you're using.
e.g. to generate hashes you could use: http://nule.org/wp/?page_id=86
run this from a batch file with:
java -jar JMd5Sum.jar
when you are selecting android Tools -> Add support Library option .it has automatically added compatible v4 library .android os is telling which one is compatible with your project.
If you wants to add particular version of any jar .firstly you have downloaded and put manully in libs folder then it added as external jar.
Build a SHA1 hash of the support library v4 jar file and compare the result with the listed hashes here: http://www.smartphoner.org/2014/11/23/android-support-library-v4-revisionen-und-hashes/
Nower days the actual support library revision is equal to the api level of the newest android version. Currently this is 21 (Lollipop).
Android SDK can show the version of Android support Repository, and make sure you download Android Support Repository by using Android SDK Manager.
If you really want to add an old support lib, you can check the version under Android studio. Right click your project, select "Open Module Settings" -> then select your app modules -> "Dependencies" . You can check your support lib version.

How to properly add an Android library to a previously made Android project?

I'm trying to add a 2.2 sdk to my project and can't seem to figure out how. I tried adding it as an external JAR in the Android sdk folder but ive encountered some errors. How could I add another Android sdk to a previously made Android project?
What you're trying to do is change the SDK version that you're project is targeting. You do not do this by including another jar in your project, you do it by changing the target SDK and minimum SDK for you project. Take a look here on how to do that and for more information:
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
You can't add an SDK to a project, but you can set your project to use a different SDK. To do this, you need to edit the properties of the project (Right-click on the project head in eclipse, and select "Properties"). You can change the SDK to any that you have downloaded through the eclipse plugin.
Note that if you want to support different levels of SDKs, you need to have your project targeted for the lowest of the two platforms. For instance, if you want your project to be compatible with both 1.6 and 2.2, you need to set your project target SDK to 1.6.
An alternative to this would be to create 2 different versions of your application and release them to market.
its simple
right on properties of a project
select android on left side menu
change the sdk version
thats it......

Categories

Resources