kingdom578 / maven-android-plugin

Automatically exported from code.google.com/p/maven-android-plugin
0 stars 0 forks source link

Can no longer build on 3.5.2 or 3.5.3. #370

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. My build was working fine with AndroidAnnotations, Dagger, and a slightly 
modified version of CleanAndroidCode project that adds additional entry point 
classes (EApplication, EService, etc.)
2. After moving to 3.5.2 of AndroidAnnotations I am getting compilation errors.
3. Also tried 3.5.3 and same result.

What is the expected output?
A successful built.

What do you see instead?
This compilation error:
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] 
/Users/bill/Source/IA/autom/examples/users-app/src/main/java/com/ia/autom/exampl
es/users/app/UsersApp.java:[8,35] cannot find symbol
symbol  : class EntryPointsModule
location: package info.piwai.cleanandroidcode
[ERROR] 
/Users/bill/Source/IA/autom/examples/users-app/target/unpack/apklibs/com.ia.auto
m_autom-authenticator_apklib_0.1-SNAPSHOT/src/com/ia/autom/authenticator/Authent
icatorActivity.java:[44,20] attribute value must be constant
[ERROR] 
/Users/bill/Source/IA/autom/examples/users-app/target/unpack/apklibs/com.ia.auto
m_autom-authenticator_apklib_0.1-SNAPSHOT/src/com/ia/autom/authenticator/Authent
icatorActivity.java:[52,19] attribute value must be constant
[ERROR] 
/Users/bill/Source/IA/autom/examples/users-app/target/unpack/apklibs/com.ia.auto
m_autom-authenticator_apklib_0.1-SNAPSHOT/src/com/ia/autom/authenticator/Authent
icatorActivity.java:[53,19] attribute value must be constant
[ERROR] 
/Users/bill/Source/IA/autom/examples/users-app/target/unpack/apklibs/com.ia.auto
m_autom-authenticator_apklib_0.1-SNAPSHOT/src/com/ia/autom/authenticator/Authent
icatorActivity.java:[54,19] attribute value must be constant
[ERROR] 
/Users/bill/Source/IA/autom/examples/users-app/target/unpack/apklibs/com.ia.auto
m_autom-authenticator_apklib_0.1-SNAPSHOT/src/com/ia/autom/authenticator/Authent
icatorActivity.java:[105,16] attribute value must be constant
[ERROR] error: Unexpected error. Please report an issue on AndroidAnnotations, 
with the following content: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
    at com.googlecode.androidannotations.helper.AnnotationHelper.extractAnnotationParameter(AnnotationHelper.java:293)
    at com.googlecode.androidannotations.helper.AnnotationHelper.extractAnnotationResIdValueParameter(AnnotationHelper.java:269)
    at com.googlecode.androidannotations.helper.IdValidatorHelper.resIdsExist(IdValidatorHelper.java:45)
    at com.googlecode.androidannotations.validation.EActivityValidator.validate(EActivityValidator.java:55)
    at com.googlecode.androidannotations.validation.ModelValidator.validate(ModelValidator.java:56)
    at com.googlecode.androidannotations.AndroidAnnotationProcessor.validateAnnotations(AndroidAnnotationProcessor.java:414)
    at com.googlecode.androidannotations.AndroidAnnotationProcessor.processThrowing(AndroidAnnotationProcessor.java:364)
    at com.googlecode.androidannotations.AndroidAnnotationProcessor.process(AndroidAnnotationProcessor.java:341)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:627)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:556)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:701)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:987)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:170)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:684)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:118)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.googlecode.androidannotations.helper.AnnotationHelper.extractAnnotationParameter(AnnotationHelper.java:287)
    ... 45 more
Caused by: java.lang.annotation.AnnotationTypeMismatchException: Incorrectly 
typed data found for annotation element public abstract int 
com.googlecode.androidannotations.annotations.EActivity.value() (Found data of 
type int)
    at com.sun.tools.javac.model.AnnotationProxyMaker$ValueVisitor$1.generateException(AnnotationProxyMaker.java:243)
    at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:57)
    at com.sun.proxy.$Proxy57.value(Unknown Source)
    ... 50 more

[ERROR] 
/Users/bill/Source/IA/autom/examples/users-app/target/unpack/apklibs/com.ia.auto
m_autom-authenticator_apklib_0.1-SNAPSHOT/src/com/ia/autom/authenticator/Authent
icatorActivity.java:[49,35] Unexpected error. Please report an issue on 
AndroidAnnotations, with the following content: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
    at com.googlecode.androidannotations.helper.AnnotationHelper.extractAnnotationParameter(AnnotationHelper.java:293)
    at com.googlecode.androidannotations.helper.AnnotationHelper.extractAnnotationResIdValueParameter(AnnotationHelper.java:269)
    at com.googlecode.androidannotations.helper.IdValidatorHelper.resIdsExist(IdValidatorHelper.java:45)
    at com.googlecode.androidannotations.validation.EActivityValidator.validate(EActivityValidator.java:55)
    at com.googlecode.androidannotations.validation.ModelValidator.validate(ModelValidator.java:56)
    at com.googlecode.androidannotations.AndroidAnnotationProcessor.validateAnnotations(AndroidAnnotationProcessor.java:414)
    at com.googlecode.androidannotations.AndroidAnnotationProcessor.processThrowing(AndroidAnnotationProcessor.java:364)
    at com.googlecode.androidannotations.AndroidAnnotationProcessor.process(AndroidAnnotationProcessor.java:341)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:627)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:556)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:701)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:987)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:170)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:684)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:118)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.googlecode.androidannotations.helper.AnnotationHelper.extractAnnotationParameter(AnnotationHelper.java:287)
    ... 45 more
Caused by: java.lang.annotation.AnnotationTypeMismatchException: Incorrectly 
typed data found for annotation element public abstract int 
com.googlecode.androidannotations.annotations.EActivity.value() (Found data of 
type int)
    at com.sun.tools.javac.model.AnnotationProxyMaker$ValueVisitor$1.generateException(AnnotationProxyMaker.java:243)
    at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:57)
    at com.sun.proxy.$Proxy57.value(Unknown Source)
    ... 50 more

What version of maven-android-plugin are you using?
3.5.2 or 3.5.3

What are the complete output lines of "mvn -version" on your machine?
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 
21:51:28+0800)
Maven home: /usr/local/Cellar/maven/3.0.5/libexec
Java version: 1.6.0_45, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.7.5", arch: "x86_64", family: "mac"

Please provide any additional information below.
I can't provide all of the AuthenticatorActivity source, but here are the lines 
that it is complaining about:
44) @EActivity(R.layout.login)
52)    @ViewById(R.id.message) TextView messageText;
53)    @ViewById(R.id.password_edit) EditText passwordEdit;
54)    @ViewById(R.id.username_edit) EditText usernameEdit;
105)     @Click(R.id.ok_button) public void onOk() {

Given that all of these reference resources, my guess is that this problem may 
be related to the following pull request that makes R.class have non-final ints:
https://github.com/jayway/maven-android-plugin/pull/184

It may also be useful to know that my AuthenticatorActivity is contained in an 
apklib that is a dependency of my top-level Application (UsersApp).

Original issue reported on code.google.com by mccord.b...@gmail.com on 20 Apr 2013 at 9:56

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Sorry, I meant this is failing with maven-android-plugin 3.5.2 and 3.5.3, not 
AndroidAnnotations. I will also file a defect against AndroidAnnotations as 
this may be where the real problem lies.

Original comment by mccord.b...@gmail.com on 20 Apr 2013 at 10:01

GoogleCodeExporter commented 9 years ago
AndroidAnnotations issue: 
https://github.com/excilys/androidannotations/issues/566

Original comment by mccord.b...@gmail.com on 20 Apr 2013 at 10:10

GoogleCodeExporter commented 9 years ago
I was able to compile by using the resName parameter on my AndroidAnnotation 
annotations instead of the constant R id as per the instructions in this wiki:
https://github.com/excilys/androidannotations/wiki/Library-projects#referencing-
ids-by-name

I'm not quite sure why this fixes the issue, but it does, so please close.

Original comment by mccord.b...@gmail.com on 20 Apr 2013 at 8:35

GoogleCodeExporter commented 9 years ago

Original comment by mosa...@gmail.com on 24 May 2013 at 5:06