1

I'm trying to pull a project from git, in particular, this one: https://github.com/pocmo/Yaaic.

It is a library for IRC clients in android which I wanted to use to put an IRC client into an android app. As you can see from the root directory of this project there is no AndroidManifest.xml but there is a directory called "application" which does contain a manifest file. From this I'm assuming that the application directory contains a sample Android app which demonstrates an IRC client (the Yaaic app itself). However, when I import just the application directory as a project into Eclipse, it is filled with build path errors and results errors involving use of non-existing stuff. I tried importing the entire directory I directly pulled from git hub as a project and there are still lots of build path problems.

As for the project itself, I'm not really sure whether its the source code for the Yaaic app or its the source code for a library or platform for use in other Android projects. Hell, I'm not even sure I can use the Yaaic project as a library for IRC functionality in my own Android apps.

I'm fairly new to Android development and development on Eclipse in general only experience is some dummy projects from university and the tutorials from the android development website.

xialu
  • 13
  • 1
  • 3
  • You have actionbarsherlock in place in your eclipse project? The commit message for the readme clearly states "*Add ActionBarSherlock to README.*" You did not state you have actionbarsherlock in the eclipse project so. Obviously you did not read the README on the github repo... just saying :) – t0mm13b Jun 24 '12 at 21:54
  • See this is the part I got confused about, there is a directory /Yaaic/libs/ActionBarSherlock in the project I have on eclipse. This directory is not in the libs directory of the application though: /Yaaic/application/libs which is what I think the actual working demo is. There are classes within /Yaaic/application which uses ActionBarSherlock and certain layout resource xmls seems to also need ActionBarSherlock. Either way apparently ActionBarSherlock wasn't included in the build path of the actual application. – xialu Jun 24 '12 at 22:25
  • As for the readme, I did go through it a few times before pulling the project to see if it was what I wanted and to see if there's any guide or instruction into using the project or getting started. I don't really know what "Add ActionBarSherlock to README." is pertaining to. I'm guessing the developers of Yaaic wanted to add some kind of comment about ActionBarSherlock into the README. What I found in the readme was what I thought to be a nod, or gesture of giving credit to the developer of the ActionBarSherlock library. I don't think this actually addresses my problem with the build paths. – xialu Jun 24 '12 at 22:29
  • You need to find out how to add ActionBarsherlock to the project and make it as a library in order to resolve the build errors within the YAAIC source. – t0mm13b Jun 24 '12 at 23:15

2 Answers2

4

As author of Yaaic I should be able to help you with that. :)

Your initial idea is right: There are a bunch of folders but the "application" folder is the one you want to import as a project.

Yaaic has some dependencies to other libraries. I don't use a tool for dependency management (e.g. maven) yet so I ship the needed libraries in the "libs" folder.

So what you need to do is:

  1. Create an Android library project for ActionBarSherlock pointing to libs/ActionBarSherlock
  2. Create an Android library project for ViewPagerIndicator pointing to libs/ViewPagerIndicator
  3. Create an Android project for Yaaic pointing to application/
  4. Depending on you file system layout you may need to update the locations of the other projects (right click on the project -> properties -> android)
  5. Ensure that the support library is in the build path of every project (should be automatically with the last version of the ADT as it's in every project's libs folder)

Eclipse may be bitchy so you sometimes need to "refresh" or "clean" the project in order to build it successfully.

I want to switch to maven-based builds soon. That should make things much easier. ;)

pocmo
  • 660
  • 6
  • 24
3

As for the project itself, I'm not really sure whether its the source code for the Yaaic app or its the source code for a library or platform for use in other Android projects. Hell, I'm not even sure I can use the Yaaic project as a library for IRC functionality in my own Android apps.

Yaaic isn't a library, it's an application. The clue is in its full name Yet Another Android IRC Client ;-). However, the code you've downloaded is licensed under the GPLv3, so there is nothing stopping you from pulling out bits of the project for your own use as long as you keep to the terms.

Having said that, here's how I got it up and running. Some of these steps you have already run, but I've documented them all for completeness.

First I cloned the repo with the following command into a directory Yaaic

git clone http://github.com/pocmo/Yaaic Yaaic

Then in eclipse import->Existing Project into Workspace and select the directory created above as the root directory.

Your window should now look like this:

Eclipse project import dialog

The Yaaic directory I'd created was under my workspace so I just selected Finsh

Cue warnings about missing build paths and the like.

  1. Uncheck Project->Build Automatically.
  2. Select the ActionBarSherlock Project in the left pane and press Alt+Enter for the project properties, and select Android: enter image description here
  3. Ensure a Project Build Target is selected as above (this seemed to be the silver bullet), and obviously leave Is Library checked.
  4. Select OK and repeat for the ViewPageIndicator project.
  5. At this point I cleaned the four new projects, hit F5 to refresh and restarted eclipse. I could also have touched a lucky rabbits foot, but didn't have a rabbit to hand ;-p
  6. Switching Build Automatically back on to started the building process, and once complete you should be able to run Yaaic on your device or AVD.
Chilledrat
  • 2,593
  • 3
  • 28
  • 38