xialu
xialu

Reputation: 13

Importing a clone from github into Eclipse and build path errors

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.

Upvotes: 1

Views: 4098

Answers (2)

Chilledrat
Chilledrat

Reputation: 2605

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.

Upvotes: 3

pocmo
pocmo

Reputation: 660

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. ;)

Upvotes: 4

Related Questions