no suitable constructor found for HeaderItem(int,String,)

I got following error when I try to build android TV sample application.

D:\workspace\androidstudio\AndroidTVsample\app\src\main\java\com\corochann\androidtvsample\MainFragment.java
Error:(109, 33) error: no suitable constructor found for HeaderItem(int,String,<null>)
constructor HeaderItem.HeaderItem(long,String) is not applicable
(actual and formal argument lists differ in length)
constructor HeaderItem.HeaderItem(String) is not applicable
(actual and formal argument lists differ in length)
Error:(113, 33) error: no suitable constructor found for HeaderItem(int,String,<null>)
constructor HeaderItem.HeaderItem(long,String) is not applicable
(actual and formal argument lists differ in length)
constructor HeaderItem.HeaderItem(String) is not applicable
(actual and formal argument lists differ in length)
D:\workspace\androidstudio\AndroidTVsample\app\src\main\java\com\corochann\androidtvsample\PlaybackOverlayFragment.java
Error:(316, 29) error: no suitable constructor found for HeaderItem(int,String,<null>)
constructor HeaderItem.HeaderItem(long,String) is not applicable
(actual and formal argument lists differ in length)
constructor HeaderItem.HeaderItem(String) is not applicable
(actual and formal argument lists differ in length)
D:\workspace\androidstudio\AndroidTVsample\app\src\main\java\com\corochann\androidtvsample\VideoDetailsFragment.java
Error:(156, 33) error: no suitable constructor found for HeaderItem(int,String,<null>)
constructor HeaderItem.HeaderItem(long,String) is not applicable
(actual and formal argument lists differ in length)
constructor HeaderItem.HeaderItem(String) is not applicable
(actual and formal argument lists differ in length)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Error:Execution failed for task ':app:compileDebugJava'.
> Compilation failed; see the compiler error output for details.

The reason of this error happens is because the definition of the constructor HeaderItem.HeaderItem(long,String) has changed. We need to change

from HeaderItem(id, string, null) to HeaderItem(id, string).

So we need to delete “null” argument for all occurrences in the function.

Leave a Comment

Your email address will not be published. Required fields are marked *