I´m new to Android World but I really like it, I programmed some apps and now I would like to try the ActionBarSherlock specially for the tabs menu.
I have Eclipse Juno version 4.2, I use jdk-7u5 and the latest version of SDK (v.20)
I want to install ActionBarSherlock version 4.1
As in Eclipse Juno there is no "Select Create project from existing source" option I imported Sherlock library as a existing project on Eclipse and a red cross appears in almost all packages in src.
Then, I added it as library on my own project. Now a red exclamation mark appears on my Android Aplication Project.
I´m using android:minSdkVersion="7" android:targetSdkVersion="14"
I read a lot about different problems with the library ActionBarSherlock and I tried everything they say in the forum, even install Eclipse Helios to use
the option "Select Create project from existing source", but I had an Installation Problem with ADT.
Thank you in advance everybody.
I found this tutorial wich solve the problem I had with ActionBarSherlock.
Here it is http://androiddevelopmenttutorial.co/actionbarsherlock-getting-started/
From this web http://www.grokkingandroid.com/adding-actionbarsherlock-to-your-project/
Getting ActionBarSherlock and adding it to Eclipse
The first thing you have to do, is to download the library from actionbarsherlock.com. After this unzip/untar it. The download contains three folders: library, samples and website. The samples folder contains four sample projects to showcase what you can do and to show you how to do it. You should have a look at them. The website folder contains the code of the project website. The library folder finally contains ActionBarSherlock’s source code.
Now go to Eclipse and add the ABS-library as an Android project. Do not use Eclipse’s import tool to import the ActionBarSherlock library – it would not work immediately and you would have to fix some settings. Instead use the project creation wizard of the Android Developer Tools.
Open File -> New -> Project -> Android Project From Existing Code.
Creating an Android project from existing source
In the next screen select the folder, which Eclipse then uses to search for projects. If you select the ActionBarSherlock root folder, Eclipse suggests a list of projects to create. Leave the “library” project checked and uncheck all others:
Select the library project
Click “Finish” to create the project.
Eclipse will now create a new project named “library”. I prefer a more useful name, so select the project called “library” and hit F2 to rename the project. I have renamed the project in Eclipse to “ActionBarSherlock”, so all following screens will refer to this name.
Adding the library to your project
Now that ABS is a library project you have to tell your own project to use it. I will use the project of my last post for this. Go to FragmentStarter’s project settings and switch to the Android tab.
If necessary scroll down until you see the Library panel. Click “Add”:
Adding libraries to an Android project
In the next window all available library projects will be listed. Select ActionBarSherlock and click “Ok”.
Select ActionBarSherlock from the list of libraries
When the window disappears the library should be listed in the library panel of the Android properties tab:
Check if the library has been added succesfully
Then appears an error: Jar mismatch! fix your dependencies, to solve it there is to copy the file android-support-v4.jar from your_project/libs and paste it on library/libs.
Before you can use ActionBarSherlock you have to extends your Activity like this: public class MainActivity extends SherlockActivity and change the theme in Manifest: android:theme="#style/Theme.Sherlock.Light.DarkActionBar"
This is the way to add ABS to your project. Hope it works for all
Related
I'm very new to Android. Whenever I create a new project using a new workspace, I get an exclamatory red mark in Eclipse in my project and an error at Appcompat. I searched here for an answer, but no answer was what I was looking for, so I just asked this. When I create a workspace at DDMS it displays this:
Sending Tracking request failed!
At Android, after I create a new project
WARNING: unable to write jarlist cache file here, src file, layout file not available.
I've searched a lot and found no solution.
OK, first thing first. Eclipse is no longer supported by Google. The only official IDE for Android Development is Android Studio Download Page.
Here is the announcement of Eclipse support ending
Over the past few years, our team has focused on improving the development experience for building Android apps with Android Studio. Since the launch of Android Studio, we have been impressed with the excitement and positive feedback. As the official Android IDE, Android Studio gives you access to a powerful and comprehensive suite of tools to evolve your app across Android platforms, whether it's on the phone, wrist, car or TV.
To that end and to focus all of our efforts on making Android Studio better and faster, we are ending development and official support for the Android Developer Tools (ADT) in Eclipse at the end of the year. This specifically includes the Eclipse ADT plugin and Android Ant build system.
Please note that the number of people using Eclipse to develop Android apps are going down. You will get less and less support even on Stackoverflow as time goes by. Overall, it is better to just make the switch while you are just starting.
Check on the first link, you will see some amazing documentation in the Android Studio IDE
If you 100% required to use Eclipse...
OK, so you have a job that requires Eclipse or there is some other reason, then check out this documentation by Eclipse.
Also, here is a list of all the different icons that can be displayed by Eclipse (credit for the icon list).
Build path problems are sometimes easy to miss among other problems in a project. The Package Explorer and Project Explorer views now show a new decorator on Java projects and working sets that contain build path errors:
The concrete errors can be seen in the Problems view, and if you open the view menu and select Group By > Java Problem Type, they all show up in the Build Path category:
Please refer this link too here
If you go to appcompat_v7/bin folder, you'll see that file "jarlist.cache" doesn´t appear or is unsynchronized. You need to
refresh the appcompat_v7 folder, only press F5 over that folder.
The appcompat_v7 folder is added because you use an action bar
component.
Aah. To avoid a new appcompat_v7_XX folder when you are creating a new
project, choose a LEVEL API 14 as Minimun Required SDK. After you must
modifier the AndroidManifest.xml and put the level that you need.
change it
android:targetSdkVersion="19" />
Delete all appcompat_v7_XX. It is a bug.
With appcompat_v7, You will see that Eclipse creates two XML files:
Activity_main.xml and fragment_main.xml. If you want to have an option
to create a project in the old way only with activity_main.xml, do
that:
Make a copy of the folder "BlanckActivity" located in this path:
\sdk\tools\templates\activities of an ADT previous version.
Rename the folder as “BlankActivityNoFragment”, then edit the field
name of the file "template.xml" with a notepad as
name=”BlankActivityNoFragment”
Copy the new folder in the same path of the new Eclipse
IDE:sdk/tools/templates/activities
Now you´ll see the new template when you go to create a new project.
Remember to choose as Minimum Required SDK an API 14
If you don't want the support of appcompat library then just remove it from your project by following steps :
Right click on project
Select properties
In dialog select android on left side
In dialog check library section
Remove appcompat library by selecting it and press remove
Extends your MainActivity.java with Activity
You can run your project successfully.
If you want the support of appcompat then follow this steps :
download the latest appcompat using Sdk Manager
import appcompat project in your eclipse
add it as a library project
extend your MainActivity with AppCompatActivity.
If you're getting any problem with app_compact library... This is the solution
Hopefully it will work....
According to the documentation
Decorates Java projects and working sets that contain build path
errors
There can be several reasons. Most of the times it may be some of the below reasons ,
You have deleted some of the .jar files from your /lib folder
You have added new .jar files
you have added new .jar files which may be conflict with others
So what to do is we have to resolve those missing / updating / newly_added jar files.
right click on the project and go to properties
Select Java Build Path
go to the Libraries tab
Remove the references of the jar files which you have removed already. There will be a red mark near them so you can identify them easily.
Add the references to the newly added .jar files by using Add JARs Refresh the project
This will solve the problem if it's because one of the above reasons.
Still Facing problem ??Try this:
Go to Windows -> Preferences -> Android -> Build and uncheck "Skip packaging and dexing until export or launch" then restart Eclipse.
I am trying to import the Support v7 library to get ActionBarActivity however it is not working. I am unable to extend ActionBarActivity.
I followed the tutorials of adding the support library in from these links
https://developer.android.com/tools/support-library/setup.html
http://hmkcode.com/add-actionbar-to-android-2-3-x/
I followed these line by line however i cannot import android.support.v7.app.ActionBarActivity; it seems to not exist. All i can import is android.support.v7.app.appcompat.R;
I am using Eclipse
Can someone help me out please. Many Thanks!.
This is the summary of what I have done which is working now
Went to SDK manager. Checked that I have the latest Android Support Library ( I have Rev 20). I did not install Support Repository as this is for android studio
Imported existing code into workspace. Selected sdk/extras/android/support/v7/appcompat/. I did NOT check copy to workspace.
right-click each .jar file and select Build Path > Add to Build Path. For example, when creating the the v7 appcompat project, add both the android-support-v4.jar and android-support-v7-appcompat.jar files to the build path.
Right-click the library project folder and select Build Path > Configure Build Path.
In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the appcompat project requires you to export both the android-support-v4.jar and android-support-v7-appcompat.jar files.
Uncheck Android Dependencies.
what I did differently was Create a new Android project rather than using an existing. By default it seemed to extend ActionBarActivity automatically since I put min SDK to API 8.
What it also did was actually do all the steps above for me! I see new project in my work space appcompat-v7
The only problem I see is on console it said something like unable to write Java cache. I lost the message but I will post it
You can create a new Project(if possible) with the viewpager activity and select actionbar in the settings. This will automatically import it into your NEW project. If you can copy your old files that'd be great.
You basically have to:
Import the android-support-v7-appcompat to your Eclipse as described on these links you read.
Link your own project with 'android-support-v7-appcompat' by going to Project Properties / Android/ Add the 'android-support-v7-appcompat' under the 'Library' section (there's a 'Add' button).
I am trying to use jfeinstein10 / SlidingMenu http://goo.gl/PEZ9M in my android application.First I have added library project of Sliding Menu, then I added ActionBarSherlock too.Sliding Menu library is dependent to ActionBarSherlock.
Also my app is dependent to SlidingMenu app.
My question is that when I add a library project as a dependency to my main project, the R file of the main project disappears and all my R references in main project cannot be resolved.
does anyone know that R file disappearance issue after adding a library project as a dependency?
Use the Project Properties and clicking on the Android section, change the Project Build Target to Android 4.0.3 (API 15). Clean the project after changing the API Level.
Ok I just struggled through this issue for quite some time now I finally resolved it here are the steps I took.
First of all I updated the android SDK for eclipse to the latest version.
Then I updated eclipse itself by going to Help --> Check for updates
next downloaded the latest version of SlidingMenu and ActionBarSherlock and unzipped them to a folder
Then in eclipse import ActionBarSherlock by creating "New Android Project from existing source" and selecting the "library" folder in the unzipped directory
Repeat the above step for SlidingMenu
Very important at this point to make sure you don't have any errors in your both imported library projects
If you have errors in the ActionBarSherlock then right click the project goto "Android Tools" --> "Add Support libraries". This should resolve any issues you have if not then goto project --> clean and clean up the project
The sliding menu will have a target of 2.2 or 2.1 by default (sorry cant remember which one...its really late and my head feels foggy :z)
Right click on the SlidingMenu project and select properties in the window that opens select target build of Google APIs 4.0.3 select ok and do a CTRL + SHIFT + O and any issues or warnings you had should go away.
With that out of the way then once again right click on the SlidingMenu project and select properties. In the window under Android scroll all the way down and add reference to the ActionBarSherlock library. Also make sure the "Is Library" checkbox is checked. Apply and ok.
Next you have to do the same for your project. Right click on it --> Properties under Android Scroll all the way down and add SlidingMenu as a library. Make sure the "Is Library" checkbox is NOT checked.
At this point I encountered Dependency errors. The problem is that in your projects "libs: folder you will have the files: "android-support-v13.jar" and "android-support-v4.jar" causing a conflict.
What I did was delete the v4 and copy pasted the v13.jar file into the libs folder of all 3 projects, my project, SlidingMeny and ActionBarSherlock.
This resolved the above issue and it worked!
Hope this helps someone so they can go to sleep at sane hours of the night! :)
I just ran into this problem and I didn't need to change my build target. What I had to do it make sure my app and any library that implemented the support Library was using the same support Library version. The easiest way to do this:
Right click on each project and library that is in question and select Android Tools -> Add Support Library... *
I'm trying to get ActionBarSherlock and the ViewPagerIndicator libraries set up for my projects, but I seem to be running into a few issues. I sent Jake Wharton (The developer) a few messages earlier about it, and got a few replies but couldn't get anywhere - and I think he got busy with a few other things.
What my issue is, For both VPI and ABS
Both libraries open up without any errors, and I'm using compiler version 1.6 for all as is required.
The funny thing is, if I load in the samples that are provided - they work fine and link to his library; but when I go to add the library to my project - the above happens.
Where to store the actual library project does not matter, as long as you use a relative link to reference it. Check out the Library Projects - Development considerations:
Library project storage location
There are no specific requirements on where you should store a library project, relative to a dependent application project, as long as the application project can reference the library project by a relative link. What is important is that the main project can reference the library project through a relative link.
You should always use the Eclipse ADT plugin to select and set up Library Project Reference, i.e. right-click project -> Properties -> Android -> Add, then in the opened Project Selection window, select the Library Project list here (of cause you should import them in the same Eclipse workspace as your Main Project). This will add a android.library.reference using relative path into project.properties as well as show relative path in the Android preference window:
android.library.reference.2=../../../../../Documents and Settings/yorkw/Desktop/JakeWharton-Android-ViewPagerIndicator-f09acb0/library
If you directly alter it using absolute path from project.properties as below:
android.library.reference.1=C:\\Documents and Settings\\yorkw\\Desktop\\JakeWharton-Android-ViewPagerIndicator-f09acb0\\library
Then after Eclipse refresh your project, you get the exact error described in your question, see my screenshot below:
Hope this helps.
While importing the libraries, make sure that you tick the "Copy projects int workspace" check box. The library projects need to be in the same workspace for them to work.
delete and import the project and lib again. build the lib project , add lib to project, still error shows.. rename the lib project. this worked for me ....
I want to make some ActionBar for my application using this library: https://github.com/johannilsson/android-actionbar but I don't know how to import it in my android project. There is no jar file. How can I do?
Flo
First, make sure you're using the latest version of the Android SDK, things have improved dramatically within the last few months.
Install the android-actionbar source code, either downloading it and unpacking it, or (preferably) using git to clone the repository on your system.
(I strongly recommend using the mimic-native-api branch as it is the most up to date.)
Import the android-actionbar project into Eclipse. Note that the library's .project file is located in android-actionbar/actionbar. There is a small sample project in android-actionbar/actionbarexample as well.
The project's library setting should already be set, but you can confirm this by right-clicking on the android-actionbar project in Eclipse, choosing Properties, and confirming that "Is Library" is enabled in the Android settings category.
In Eclipse, right-click on the project that you want to use the action bar library in, and choose Properties. Select the "Android" category in the list on the left. In the "Library" settings on the right, click the "Add..." button and select the android-actionbar library project.
Tip: I've found Eclipse can get a bit squirrely when you edit library code, if you run into errors that don't want to go away, use Project > Clean... to remove the R.java files, etc. ...then refresh your package explorer and rebuild.
You'll want to look at http://developer.android.com/guide/developing/projects/projects-eclipse.html#SettingUpLibraryProject and http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject. The first link explains how to create a Library project: you probably just need to take the github zip file, expand it and then add it to Eclipse. You can then import it into your own project in Eclipse.
Just copy the source into your project folder and add each file as a new class