Wrong argument type for 'sizes' in argument bundle. string[] expected

error executing code: wrong argument types for comparison
wrong type of argument for conversion function

The received stacktrace:

java.lang.IllegalArgumentException: Wrong argument type for 'sizes' in argument bundle. string[] expected. at androidx.navigation.NavDestination.addInDefaultArgs(NavDestination.java:524) at androidx.navigation.NavController.navigate(NavController.java:932) at androidx.navigation.NavController.navigate(NavController.java:867) at androidx.navigation.NavController.navigate(NavController.java:804) at androidx.navigation.NavController.navigate(NavController.java:790) at com.example.kotinmvvm.adapter.UserAdapter$onBindViewHolder$1.onClick(UserAdapter.kt:51)

The code in User.kt:

class User {
    @SerializedName("id")
    @Expose
    var id: String = ""

    @SerializedName("name")
    @Expose
    var name: String = ""

    @SerializedName("image")
    @Expose
    var image: String = ""

    @SerializedName("desc")
    @Expose
    var desc: String = ""

    @SerializedName("sizes")
    @Expose
    val sizes = ArrayList<String>()
}

The JSON data:

{
id: 43354,
desc: "Nobis voluptatibus est necessitatibus tempore voluptate voluptatibus. Illum suscipit nam et nostrum. Est exercitationem tempore pariatur nisi soluta iure.",
name: "Prof. Carmel Ebert III",
image: "https://lorempixel.com/640/640/?81469",
sizes: [
"UK7",
"UK8",
"UK9",
"UK10"
]}

What changes are necessary to fix this issue?

That's difficult to tell without having seen the JSON.

That probably should be:

val sizes: ArrayList<String>()

or try:

var sizes: String = ""

Wrong argument type for function, Error executing code: Wrong argument type for function. With a stack trace of: (C)\​Classes\QueryRun\setRecord. (C)\Classes\FormDataSource\  k, it says 'wrong argument type'. It does this whenever I try to solve something with different variables such as k and x, but it really shouldn't. Any ideas on how to 'solve' this problem (if you'll pardon the awful pun)? make sure u put a multiplication between the k and sin, calculators sometimes do not recognise implied multiplication

To get the inner list of string object change try

  @SerializedName("sizes")
  @Expose
  var sizes : List<String>? = null

AX 2012: Error executing code: Wrong argument type for function , This is one of the oldest error plus SSRS tricks which we have worked on to get around the error: Wrong argument type for function. We saw this  Possible duplicate of -Wpedantic wrong type argument to increment after casting – Groo Mar 17 '17 at 11:00 | show 8 more comments 2 Answers 2

Try with this class

data class User(
    @SerializedName("desc")
    var desc: String = "",
    @SerializedName("id")
    var id: Int = 0,
    @SerializedName("image")
    var image: String = "",
    @SerializedName("name")
    var name: String = "",
    @SerializedName("sizes")
    var sizes: List<String> = listOf()
)

You can easily convert any JSON data to data class using this plugin

Error executing code: Wrong argument type for function , Error executing code: Wrong argument type for function SysDataBaseLog\​Methods\setDescription - line 8. Suggested Answer. Hi,. In AX2009, i  That shorter program also returns the "wrong argument type > nil (expected String)" error. However, typing the same line into irb > works fine and returns 0 (and after doing so, typing Dir.getwd into irb

Error executing code: Wrong argument types in variable assignment , Hello Guys,. I have this issue in AX 2012 r3 in shipment > functions > ship transfer order. Error executing code: Wrong argument types in variable assignment. When a function is passed an argument of the wrong type, the Lisp interpreter produces an error message. For example, the + function expects the values of its arguments to be numbers. As an experiment we can pass it the quoted symbol hello instead of a number. Position the cursor after the following expression and type C-x C-e :

How to solve 'Error: Wrong argument type for , Upon posting PO, I have encountered this problem. :( Error executing code: Wrong argument types in variable assignment. (S)\Classes\PurchFormLetter\​specQty  This can be caused by two reasons: Code is wrong, performing some invalid assignment. (You have to fix the code.) Code is correct, but your application is not compiled correctly.

Error executing code: Wrong argument type for function : Formpipe , Error executing code. Wrong argument type for function. When you just rewrite your code a bit, all of sudden it works. Only, do you know  Suddenly most of the galleries and text items where filter and count formulas are used stopped working. It shows nothing and a warning states "Invalid argument type" where the "=" syntax is used. I.e CountIf('Open Critical Incidents',Status="Active") and Filter(Messages,Visibility="Visible"). Source

Comments
  • { id: 43354, desc: "Nobis voluptatibus est necessitatibus tempore voluptate voluptatibus. Illum suscipit nam et nostrum. Est exercitationem tempore pariatur nisi soluta iure.", name: "Prof. Carmel Ebert III", image: "lorempixel.com/640/640/?81469", sizes: [ "UK7", "UK8", "UK9", "UK10" ]}
  • I have updated the post with JSON . please have a look
  • thanx . I will try
  • Let me know, if you face any issue :)