lishunli / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

@RequiredArgsConstructor in Android project gives "attribute value undefined" #420

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In my Android project, the following class:

@RequiredArgsConstructor
public class Sample {

    private final String name;
}

gives this error : 

The attribute value is undefined for the annotation type ConstructorProperties.

Adding the 1.6 JDK solved the problem so I suppose there are some classes 
missing in the android SDK that are being used by Lombok.

I strongly doubt that having both Android's and standard JDK on my classpath is 
a good thing though :)

Software versions:
Eclipse Juno
OpenJDK 1.6.0_24
Android 16 SDK (4.1)

Original issue reported on code.google.com by koen.ver...@gmail.com on 14 Oct 2012 at 12:21

GoogleCodeExporter commented 9 years ago
You need to do two things to fix this issue:

(A) Lobby team Android to add ConstructorProperties to their classpath. It is 
an annotation which the dalvik compiler eliminates any way, it has zero impact 
on the runtime side.

(B) You can use @RequiredArgsConstructor(suppressConstructorProperties=true) as 
a workaround until the lobby thing works out :)

Original comment by reini...@gmail.com on 29 Oct 2012 at 9:28

GoogleCodeExporter commented 9 years ago
FYI that there is an issue opened about this on the Android side: 
http://code.google.com/p/android/issues/detail?id=22953

Original comment by loep...@amazon.com on 6 Feb 2013 at 5:39