You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
AndroidAnnotations not going through with compilation #390
Everything was working fine until it wasn't. Saw the following error:
error: Unexpected error. Please report an issue on AndroidAnnotations, with the following content: java.lang.IllegalArgumentException
at com.googlecode.androidannotations.internal.codemodel.JInvocation.arg(JInvocation.java:144)
After repeated attempts it jumped to different parts of the source code for different annoations like @bean and @get.
@pyricau This is what I see in the Messages window in IntelliJ
Information:Processor com.googlecode.androidannotations.AndroidAnnotationProcessor matches [com.googlecode.androidannotations.annotations.rest.RestService, com.googlecode.androidannotations.annotations.rest.Delete, com.googlecode.androidannotations.annotations.BeforeTextChange, com.googlecode.androidannotations.annotations.AfterTextChange, com.googlecode.androidannotations.annotations.rest.Get, com.googlecode.androidannotations.annotations.UiThread, com.googlecode.androidannotations.annotations.rest.Post, com.googlecode.androidannotations.annotations.EFragment, com.googlecode.androidannotations.annotations.Bean, com.googlecode.androidannotations.annotations.Background, com.googlecode.androidannotations.annotations.rest.Rest, com.googlecode.androidannotations.annotations.EActivity, com.googlecode.androidannotations.annotations.EBean, com.googlecode.androidannotations.annotations.AfterInject, com.googlecode.androidannotations.annotations.rest.Put, com.googlecode.androidannotations.annotations.rest.Accept, com.googlecode.androidannotations.annotations.Click] and returns true.
Information:Note: Starting AndroidAnnotations annotation processing
Information: at com.googlecode.androidannotations.internal.codemodel.JInvocation.arg(JInvocation.java:144)
Information: at com.googlecode.androidannotations.processing.rest.MethodProcessor.generateHashMapVar(MethodProcessor.java:133)
Information: at com.googlecode.androidannotations.processing.rest.MethodProcessor.generateRestTemplateCallBlock(MethodProcessor.java:92)
Information: at com.googlecode.androidannotations.processing.rest.GetProcessor.process(GetProcessor.java:75)
Information: at com.googlecode.androidannotations.processing.ModelProcessor.process(ModelProcessor.java:47)
Information: at com.googlecode.androidannotations.AndroidAnnotationProcessor.processAnnotations(AndroidAnnotationProcessor.java:472)
Information: at com.googlecode.androidannotations.AndroidAnnotationProcessor.processThrowing(AndroidAnnotationProcessor.java:343)
Information: at com.googlecode.androidannotations.AndroidAnnotationProcessor.process(AndroidAnnotationProcessor.java:318)
Information: at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
Information: at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
Information: at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
Information: at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
Information: at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
Information: at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1106)
Information: at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
Information: at com.sun.tools.javac.main.Main.compile(Main.java:419)
Information: at com.sun.tools.javac.main.Main.compile(Main.java:333)
Information: at com.sun.tools.javac.main.Main.compile(Main.java:324)
Information: at com.sun.tools.javac.Main.compile(Main.java:76)
Information: at com.sun.tools.javac.Main.main(Main.java:61)
Information: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Information: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
Information: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Information: at java.lang.reflect.Method.invoke(Method.java:601)
Information: at com.intellij.rt.compiler.JavacRunner.main(JavacRunner.java:71)
Information:Round 2:
Information: input files: {}
Information: annotations: []
Information: last round: true
Information:Compilation completed with 13 errors and 31 warnings
Information:13 errors
Information:31 warnings
Error:: Unexpected error. Please report an issue on AndroidAnnotations, with the following content: java.lang.IllegalArgumentException
Warning:: Unclosed files for the types '[dummy1352432799465]'; these types will not undergo annotation processing
Unexpected error. Please report an issue on AndroidAnnotations, with the following content: java.lang.IllegalArgumentException
at com.sun.codemodel.JInvocation.arg(JInvocation.java:144)
at com.googlecode.androidannotations.processing.rest.MethodProcessor.generateHashMapVar(MethodProcessor.java:136)
at com.googlecode.androidannotations.processing.rest.MethodProcessor.generateRestTemplateCallBlock(MethodProcessor.java:94)
at com.googlecode.androidannotations.processing.rest.GetProcessor.process(GetProcessor.java:77)
at com.googlecode.androidannotations.processing.ModelProcessor.process(ModelProcessor.java:102)
at com.googlecode.androidannotations.AndroidAnnotationProcessor.processAnnotations(AndroidAnnotationProcessor.java:505)
at com.googlecode.androidannotations.AndroidAnnotationProcessor.processThrowing(AndroidAnnotationProcessor.java:367)
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.main.Main.compile(Main.java:279)
at com.sun.tools.javac.main.Main.compile(Main.java:270)
at com.sun.tools.javac.Main.compile(Main.java:69)
at com.sun.tools.javac.Main.main(Main.java:54)
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.compiler.JavacRunner.main(JavacRunner.java:71)
Not sure what exactly is going wrong. I tried
Rebuilt the project
Built the project in Eclipse
Checked out my project from the repo again and set it up as said in the docs
My co-worker's project was working fine but then he started getting the same error. Am wondering if it's a problem with my app code or something else.
Let's look at this. It's a part of the invoke I haven't been involved a lot so I'm rediscovering it at the same time ( @a-thomas we may need your help here).
The stacktraces comes from here when calling JInvocation.arg()
This part of the code is related to having parameters in the URL. So first, could you check all your @Rest interfaces and paste the pieces that contain URL parameters ?
Here is the content of the JInvocation.arg() method:
@pyricau Thank you for the reply! That indeed seems to be the case. I just reverted to an older version of the codebase and things started working. Will post the offending piece of code here. Is there a way this can be reported in the stacktrace? Would save a ton of time. The bad part here was that the code did compile for a couple of tries and then started working so could not guess at which point the problem started.
Activity
pyricau commentedon Nov 8, 2012
Hello @a85, thank you for reporting this error. Could you please include the full stacktrace ?
a85 commentedon Nov 9, 2012
@pyricau This is what I see in the Messages window in IntelliJ
a85 commentedon Nov 9, 2012
Upgraded to 2.7 but still the same issue. I am trying with creating a new project now.
a85 commentedon Nov 9, 2012
Recompiling again but same error.
Not sure what exactly is going wrong. I tried
pyricau commentedon Nov 10, 2012
Let's look at this. It's a part of the invoke I haven't been involved a lot so I'm rediscovering it at the same time ( @a-thomas we may need your help here).
The stacktraces comes from here when calling
JInvocation.arg()This part of the code is related to having parameters in the URL. So first, could you check all your
@Restinterfaces and paste the pieces that contain URL parameters ?Here is the content of the
JInvocation.arg()method:The calling code does:
So here, either
urlVariablescontains a null element, ormethodParamsdoesn't contain one of theurlVariable.I figured this must have been some matching problem between path parameters and method parameters.
And I found a way to reproduce the exact same stacktrace:
Do you have any URL in your
@Restinterfaces where a parameter name is duplicated?a85 commentedon Nov 10, 2012
@pyricau Thank you for the reply! That indeed seems to be the case. I just reverted to an older version of the codebase and things started working. Will post the offending piece of code here. Is there a way this can be reported in the stacktrace? Would save a ton of time. The bad part here was that the code did compile for a couple of tries and then started working so could not guess at which point the problem started.
pyricau commentedon Nov 11, 2012
I definitely agree: this should be reported as a standard error in the right place. This is a bug in AndroidAnnotations.
mathieuboniface commentedon Jan 29, 2013
Hi folks !
This one has been fixed !
No error is thrown, we just allow the user to write an url with a single parameter declared twice.
Now, with the given code :
The following generated is generated :
a85 commentedon Feb 3, 2013
Awesome!