Maven + AndroidAnnotations generated but not reachable classes

自作多情 提交于 2019-12-05 15:42:10

Well... In your maven-processor-plugin configuration you're using the old package naming for the AA processor (ie : com.googlecode.androidannotations.AndroidAnnotationProcessor).

As you're using the 3.0-SNAPSHOT, you should modify it to use the new one : org.androidannotations.AndroidAnnotationProcessor

Also, I'm not sure you really need this plugin to make AA works.

Seems the problem was caused by a dependency not being resolved.

At first Maven did not even report this missing dependency, until I started removing things from my pom which I had added in an attempt to resolve this issue.

Now, what explains that the dependency didn't get auto-resolved, is the fact that there is no such artifact on the central maven repository.

As such, I added the following repository :

<repositories>
    <!-- For developing with Android ROME Feed Reader -->
    <repository>
        <id>android-rome-feed-reader-repository</id>
        <name>Android ROME Feed Reader Repository</name>
        <url>https://android-rome-feed-reader.googlecode.com/svn/maven2/releases</url>
    </repository>
</repositories>

Resulting in that 'hidden' dependency being resolved.

This dependency seems to be needed by the

    <!-- Needed for androidannotations REST interface-->
    <dependency>
        <groupId>org.springframework.android</groupId>
        <artifactId>spring-android-rest-template</artifactId>
        <version>${spring-android-version}</version>
    </dependency>

Spring docs report that this 'hidden dependency' of which we're speaking is needed for RSS and Atom feed support by the rest-template.

What made this even weirder is that the initial activity annotated by AA got created and resolved nicely. As long as I didn't refer to a generated class, e.g. for navigation, then it did compile and run. From the moment I tried to use a class_ in code however, it went down this path.

Hope this helps !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!