Hi I found that kapt would generate some stub with...
# android
f
Hi I found that kapt would generate some stub with
@android.annotation.TargetApi(value = null)
in my project and it would cause build fail. does anyone know how to avoid it?
r
In your code are you calling @TargetApi , without putting the actual API level
f
in my kotlin file, the function is
Copy code
@TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
    fun isAsynchronous(isAsynchronous: Boolean): MessageBuilder = apply {
        this.isAsynchronous = isAsynchronous
    }
But in the generated java it is
Copy code
@org.jetbrains.annotations.NotNull()
    @android.annotation.TargetApi(value = null)
    public final com.linecorp.lineat.android.util.MessageBuilder isAsynchronous(boolean isAsynchronous) {
        return null;
    }
r
Are you sure that constant isnt null
Try this @TargetApi(21)
If that works than you know its your constant that is the issue
f
yes, constant value works but
Copy code
Build.VERSION_CODES.LOLLIPOP_MR1
is in android sdk. that is the weird thing…