Skip to content

Errors building library project with Butterknife + ksp #174

Open
@ottne

Description

@ottne

Hi all,

I've been getting errors trying to build a library project using Paris together with Butterknife and KSP. Error messages are as follows:

[ksp] Incorrectly typed @Attr value parameter. (This usually happens when an R value doesn't exist.) java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "java.lang.reflect.InvocationHandler.invoke(Object, java.lang.reflect.Method, Object[])" is null [element=setInsetLeft Setter in de.danotter.parisproxies.MaterialButtonProxy]

The declarations are like these:

@Styleable("App_MaterialButton")
class MaterialButtonProxy(private val button: MaterialButton) :
    BaseProxy<MaterialButtonProxy, MaterialButton>(button) {

    @set:Attr(R2.styleable.App_MaterialButton_android_insetLeft)
    @setparam:Px
    var insetLeft: Int = 0
    [...]
}

I've uploaded a minimal project highlighting the issue:
https://github.com/ottne/paris-test

It seems like the processor can't find the generated R2 classes, although they're definitely in the build folder with the right package name. Unfortunately I have little experience debugging processor issues, so this is as much insight as I can provide at the moment.

EDIT: I forgot to mention that the same project compiles if you replace ksp with kapt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions