Butterknife: Handle uppercase package names.

Created on 26 Apr 2016  Â·  14Comments  Â·  Source: JakeWharton/butterknife

How to use BT 8 with multiple view holders in RecyclerAdapter? onCreateViewHolder method requires a generic object that extents Recycler.Viewholder. The error is: Error:Execution failed for task ':mobile:compileDebugJavaWithJavac'.

java.lang.IllegalArgumentException: couldn't make a guess for [my package].adapter.CouponsRecyclerAdapter.categoriesViewHolder

bug

Most helpful comment

It's not possible to rename your class?

All 14 comments

Change your class name to CategoriesViewHolder

On Tue, Apr 26, 2016 at 9:07 AM Stelios Tzouvaras [email protected]
wrote:

How to use BT 1.8 with multiple view holders in RecyclerAdapter?
onCreateViewHolder method requires a generic object that extents
Recycler.Viewholder. The error is: Error:Execution failed for task
':mobile:compileDebugJavaWithJavac'.

java.lang.IllegalArgumentException: couldn't make a guess for [my
package].adapter.CouponsRecyclerAdapter.categoriesViewHolder

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/JakeWharton/butterknife/issues/507

Its not possible. Listen i have a parent viewholder that extends Recycler.Viewholder. I have 10 children viewholders that extends this parent. The method to select based on a template id what template the system should choose, can only get 1 class as a parameter and ofcourse output only one. After that you can cast the class you wan to the generic viewholder based again on the template id. This is how the RecyclerView works with multiple templates.

If you still dont understand what im talking about please let me know to paste actual code.

It's not possible to rename your class?

Wait the problem is the lower case letter of the class ?

Yes. It can't guess which part is the package and which is the class name.

LOL thank you man

i will try it and let you know

I think I can fix it for the next release regardless, though. We shouldn't need to enforce this.

It's working. Thanks. I agree that you may need to fix it, because its not nice to enforce it

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

java.lang.IllegalArgumentException: couldn't make a guess for com.example.akujobijoshua.StudentBuddy.todolis.MainActivity

i tried changing the name still doesnt work pls help

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

java.lang.IllegalArgumentException: couldn't make a guess for com.example.akujobijoshua.StudentBuddy.todolis.MainActivity

i tried changing the name still doesnt work pls help

Try changing the package name to lower case.
So it must be com.example.akujobijoshua.studentbuddy.todolis.MainActivity

is this issue fixed? Since my App is in the google play store. I cannot change the package name. Any help?

@KingdeJosh Can you please tell me which version of Android studio I need to use or any other tools versions

Was this page helpful?
0 / 5 - 0 ratings