-
Notifications
You must be signed in to change notification settings - Fork 0
Eclipse ivy configuration
Please note that there are two important JARs in AndroidAnnotations:
-
androidannotations-X.X.X-api.jaris the API JAR, it must be in your build path and will be part of the final APK -
androidannotations-X.X.X.jaris the processor JAR, it is only needed at compile time, and must be in the compiler classpath.
- Eclipse 3.7
*[
ivy-ideplugin] (http://ant.apache.org/ivy/ivyde/) 2.3 or superior.
In case the ivy-ide plugin 2.3 is not publicly released, you can use the [nightly install repository] (https://builds.apache.org/job/IvyDE-updatesite/lastSuccessfulBuild/artifact/trunk/build/). As a matter of fact, the nightlies are pretty stable
Add the following
- Create the ivy manifest in the root of your project
<ivy-module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.0"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd" >
<info
module="your-module-name"
organisation="your.organisation.namespace" >
</info>
<dependencies>
<dependency
name="androidannotations-api"
conf="default->default"
org="org.androidannotations"
rev="X.X.X" />
</dependencies>
</ivy-module>
Update the module name, the organisation and the androidannotations-api revision as necessary.
-
Add the ivy dynamic library to your project. Go to the build path
-
Resolve the dependencies. Right click on your project and go to
Ivy > Resolve. Now ivy is retrieving the dependencies (and the source files if available)
- Put
androidannotations-X.X.X.jarin a different folder, such ascompile-libs.androidannotations-X.X.X.jarmust not go in thelibsfolder. - Go to
Java Compilerand make sure thatCompiler compliance levelis set to 1.6, otherwise the processor won't be activated - Go to
Java Compiler > Annotation Processingand chooseEnable annotation processing - Go to
Java Compiler > Annotation Processing > Factory Pathand add the processor JAR :androidannotations-X.X.X.jar. - Confirm the workspace rebuild
- Go to
Java Build Path > Librariesand add the API JAR :androidannotations-X.X.X-api.jar, unless it's already in the build path (ADT 17 automatically adds JARs that are in the libs folder). - You can start using AndroidAnnotations
-
To check that AndroidAnnotations is activated, you should see AndroidAnnotations logs in the Eclipse Error Log (
Window > Show View > Error Log) as soon as you save a file. If you do not see any log here, then it means AndroidAnnotations isn't activated yet. -
If AndroidAnnotations isn't activated, this may be a Java version problem. You should check that
eclipse.inidoesn't contain-Dosgi.requiredJavaVersion=1.5, and otherwise change it to-Dosgi.requiredJavaVersion=1.6. -
When AndroidAnnotations is activated, You should now see any annotation problem as a regular error marker within the editor and in the Problem view.
-
Your project name should be identical to the name of the folder containing the project. When importing a project in Eclipse, the project name used is the name of the folder. Since the annotation jar is referenced by
projectName/lib/androidannotations-X.X.X.jar, you may otherwise encounter errors when coworkers import your project. -
If you get a
java.lang.IllegalArgumentException: already added: Lcom/googlecode/androidannotations/annotations/AfterInject;when compiling, please check that you did not put the processor jarandroidannotations-X.X.X.jarin thelibsfolder. -
If you get a
java.lang.NoClassDefFoundErrorat runtime, please verify inproject properties > Java Build Path > Order and Exportthatandroidannotations-xxx-api.jaris checked.
AndroidAnnotations was created by Pierre-Yves Ricau and is sponsored by eBusinessInformations.
09/11/2014 The 3.2 release is out !
- Get started!
- Download
- Cookbook, full of recipes
- Customize annotation processing
- List of all available annotations
- Release Notes
- Examples
- Read the FAQ
- Join the Mailing list
- Create an issue
- Tag on Stack Overflow
