Appcompat does not work - android

I am trying to use appcompat in my application. I have done everything according to the instructions. But when I add android-support-v7-appcompat as a library in my proect, I have an error like so:
Description Resource Path Location Type
The container 'Android Dependencies' references non existing library
'C:\Android\workspace\android-support-v7-appcompat\bin\
android-support-v7-appcompat.jar'
testActionBar Build path Build Path Problem
what am I not doing right?

delete appcompat.jar and v4-support.jar from libs folder
clean ur project
How to add android-support-v7-appcompat as a library
import android-support-v7-appcompat in eclipse as a library project and
check copy into workspace
add android-support-v7-appcompat as library in ur project
right click on ur project -----> properties ------>android
------> add
clean ur project
I think this will help u

Before creating the project, run eclipse as Administrator so that it creates the jar in the location that it is referencing to.
Right click the eclipse icon and select the option"Run as Administrator"

Just do the following steps
appcompat_v7_nn right click build project;
click to your project, project clean

Delete jar library from every directory you add. Then you need to add appcompat as a dependency. If you use Android Studio, you need to do as following:
add this
compile 'com.android.support:appcompat-v7:18.0.+'
into your gradle dependencies and after that, Build -> Rebuild Project.

With "compatibility" files problems you can try to delete / or rename for security any appcompat "project" in eclipse and create a new project using a compatibility mode (different target and "required" SDK values, equals to your version needs), it will generate a new appcompat project, remember to link your existing project to this appcompat project and check your lib for no duplicate compat. jar.

Related

Importing an app-compat v7 library eclipse project to android studio

I have an Android application created in Eclipse, now I want to import it to Android studio, when I import project I get the following error
Project FinalProject Integrate:/home/vishal/Android_Workspace/FinalProject Integrate/project.properties:
Library reference ../android-support-v7-appcompat could not be found
Path is /home/vishal/Android_Workspace/FinalProject Integrate/../android-support-v7-appcompat which resolves to /home/vishal/Android_Workspace/android-support-v7-appcompat
and it is an unrecoverable error.
Here's what I did: In the the project.properties file I deleted all dependencies, and while importing project in Android studio I simply followed the instructions (making sure the check box are ticked, especially the one that says add any dependency). And it worked.
Edit your build.gradle, remove the dependency of project appcompat-v7
In Android studio, Go to main menu, File -> Project structure -> Dependencies, click add icon on the right side, and add appcompat-v7 as a library dependency.
Try this: Go down to the folder where the workspace and there copy the project to another folder, then open the Android studio as administrator and try again.

Adding library project to PagerSlidingTabStrip

I'm trying to use
Android PagerSlidingTabStrip v1.0.1library
in my project but, after I import the project as existing code in work space I get to project
the Mainactivity and library and and the library is a dependency to the Mainactivity
but it seems that library project doesn't recognized as local library
so what i did is
1- I tried to make a jar file called library.jar from the library project
and I imported as a external jar so that fixed my import but when I try to use PagerSlidingTabStrip object it says missing reference
and beside that there is res folder couldn't be loaded .
2- I follow this How to add a Library Project to a android project
and I did like what the accepted answer said but it still didn't work for me .
This is how I added the library project
That what I got in project libraries
I tried to use this dependency in build.gradle
dependencies {
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
}
but it didn't work
i added before sherlock to eclipse so when i added it inside the root folder
a bin folder created and inside it there are a jar file and that's
doesn't happen with library so i think here is the problem
any help?
From properties window select option android scroll down, below library heading click the add button and select library project.
I was facing the same issue but soon i came to know that there was support library missing from Library project.
Add support library and clean build the library project and then add it in your project
Do the following:
File->New->Other
Select Android Project
Select "Create Project from existing source"
Click "Browse..." button and navigate to "PagerSlidingTabStrip-master" folder which you have downloaded from https://github.com/astuetz/PagerSlidingTabStrip
Check "library"! (Uncheck "sample"). Make sure "Copy to Workspace" is checked as well.
Click Finish. Now "library" is project in your workspace.
Right-click on your project -> Properties
In Android -> Library section, click "Add"
Select recently added "library" project, click Ok and you're all set.

Project library not getting added to android project

Iam trying to reference a Android project library to my application. I do this:-
1)File->Import->General->Existing project into workspace->Select project library->check copy to workspace.
2)Right click on project->Properties->Android-> Add-> Select project library-> Apply-> ok.
But when I again check if the library is added I get the following:-
How do I resolve this?
Make sure that your library has the same location with your project source files.
It means that if your source is on your workspace , then your library should add into workspace. If not, you should copy your lib into same folder with source then mount it again.
Make sure the library project is checked as a library.
Go to the library projects BuildConfig -> Android -> Check "is library"
Make sure your project and the library project have the same target/min SDK versions.
It's also a good idea to clean your workspace and Build the library project - Right click on library project -> "Build Project"
Try this answer:
The project name needs match the folder name on the file system. What you are seeing in the Project Properties->Android->Library Reference is a relative file system path.
Reference:
In eclipse, unable to reference an android library project in another android project
Thanks to archie-bpgc for comment
i am also facing this problem i have solve this problem like
when import lib in to workspace tick mark as show in picture (basically library project and your project both are in same workspace)
now add lib to your project and clean project
you need to import the project to workspace and the library file into the same workspace.
Then you will not face this error. Kindly the root cause is not known. But this method works.
After all this .. one more way is you can alter the project properties last line where the library file path is specified.
Thank you.

Add *.jar file in folder named Android Dependencies

I want to use library from openCV named "opencv library -2.4.3" , I install all what it needs , and now openCV tutorials work. So I need add the same openCV library to my project for use.
QUESTION
How to add opencv "library -2.4.3" from another project to mine's folder named Android Dependencies
Thanks in advance
Create a libs folder (/libs) in your project's root folder.
Copy the wanted jar to it.
It will be added to Android dependencies.
You have to click on on the project properties (Right Click -> Properties) and add it as dependency there.
I just did this with a project, using eclipse 4.2.1. As with the other answerer, all I had to do was create a folder called "libs/" in my project, and it auto-updated the Android Dependencies list. Are you copying and pasting inside of eclipse?
I moved the file to that folder using the file system, outside of eclipse.
This link describes how the libs folder gets added to Android Dependencies:
http://tools.android.com/recent/dealingwithdependenciesinandroidprojects
Right click on project
Select Properties
Click on Android on left menu
Click on Add
Please select a Library Project
The jar will go into Android Dependencies.
If you add the jar directly to your project under libs or using build path, then it goes under Android Private Libraries.
Both methods works but referencing a library project can have benefits if you want to alter the code of the library during development.

ActionbarSherlock not working

I am having problems getting start with the ActionBarSherlock. I downloaded the 4.1.0 version and followed the following tutorial for installing it.
http://www.youtube.com/watch?v=4GJ6yY1lNNY
The Problem I am facing is whenever I make a new project and add the library project of ActionbarSherlock to it. I get the following error.
Description Resource Path Location Type
The container 'Android Dependencies' references non existing library 'C:\Work\JakeWharton-ActionBarSherlock-4.1.0-0-g9598f2b\JakeWharton-ActionBarSherlock-88fc341\library\bin\com_actionbarsherlock.jar' myapp Build path Build Path Problem
Please anybody help me with it.
I just had the same problem: A .jar file is requested, but non-existing. Also, it is okay that the file doesn't exist, because we want to use a Android-Library Project and not an included jar-library.
The steps described by Aqif Hamid are perfectly fine, if the missing import (.jar or library project) would be the root of the problem. But i figured out that the reason for this error is that you have to set both projects (AndroidBar Sherlock and your own Android project) to Java Compliance Level 1.6
To do so go into Project Properties => Java Compiler and set the level to 1.6
Of course, you have to install JDK 1.6 on your computer...
Hope this helps you too!
The only thing that it works for me was selecting at Properties at Java Compiler Tab Compilance Level --> 1.7 (It was 1.6).
After that Android Tools, Fix Project Properties
DO the followings:
just like you have bin, res folders. right click on your project and
add a folder named 'libs' (if libs folder is not already there).
Then copy paste your com_actionbarsherlock.jar file in this libs folder.
Right-click on your com_actionbarsherlock.jar file and click Add to Build Path.
Now clean and build your project. You should be good to go.
Edit:
To add project as a library do this:
Make sure you have your library project in your projects list and it
is open.
Right click on your project in which you want to add your library
project and select Porperties.
Click Android in properties windows, now scroll down, you will see
library section at the bottom. There press Add button.
Now a window will open in which you will see list of library
porjects. Select your required project and press Ok. Now that library
project must be there with a green tick mark.
Press Apply and Ok button.
You should be good to go now.
regards,
Aqif Hamid
I am of the understanding that you cannot include ActionBarSherlock into your project by adding a jar to your lib directory (or just including the jar at all). You will have to create an android project for ActionBarSherlock then link to it as a library:
Create ActionBarSherlock project in Eclipse
Right-click your project and go to Properties
Select Android in the left pane
Then in the right pane, towards the bottom you can Add... the ActionBarSherlock project you created in step 1.
If you are curious why the jar approach doesn't work, I give you Jake's reply in this thread
(although that's a month and a half old at this point).
1 - create a libs folder (parallel to manifest) and put the jar in that
Your Project -> right click -> Properties -> Java Build Path -> Libraries -> Add Jar ->
yourjar.jar
This video might be useful in case you are having some issues.
http://mobile.tutsplus.com/tutorials/android/jar-for-android/
Clean your actionbarsherlock project. It will generate the .jar file for you when it re-builds.
Using the Android Tools option to Add compatible libraries fixed the problem for me.

Categories

Resources