Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors building library project with Butterknife + ksp #174

Open
ottne opened this issue May 11, 2023 · 2 comments
Open

Errors building library project with Butterknife + ksp #174

ottne opened this issue May 11, 2023 · 2 comments

Comments

@ottne
Copy link

ottne commented May 11, 2023

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.

@Jparrgam
Copy link

Jparrgam commented Jun 2, 2023

Hi @ottne Have you managed to fix this somehow?

@ottne
Copy link
Author

ottne commented Jun 6, 2023

@Jparrgam, sadly, so far no. What I did is to create a separate module in which kapt is allowed to run in order to confine the stub generation as much as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants