ANDROID - JSONItem error Type mismatch error

windows V23R4

Using the code below works fine on a windows desktop app but does not compile onto an android device. unable to find anything in docs to say if any of the code is limited on android

Compile error for android.

Type mismatch error. Expected class JSONItem, but got class Dictionary
t.Write(j.ToString)

Only difference I cansee is the details at the bottom on android show

JSONItem.Constructor()
JSONItem.Constructor(dict As Dictionary)
JSONItem.Constructor(json As String)

whereas the desktop showstrong texts

JSONItem.Constructor()
JSONItem.Constructor(d As Dictionary)
JSONItem.Constructor(JSONString As String)

Var j As JSONItem
Var textin As TextInputStream
textin=TextInputStream.Open(pPrefFile)

Var data As String =textin.ReadAll
textin.Close

Var d As New Dictionary

If Not data.IsEmpty Then 
  d=ParseJSON(data)
End If

d.Value(dkey)=dvalue

j=d

Var t As TextOutputStream = TextOutputStream.Create(pPrefFile)
t.Write(j.ToString)

hoping someone can point the error of my ways or a workaround,

I’d be inclined to comment-out the offending line, then see if it will compile, then dissect it further. Are you able to start at the bottom of the method, perhaps comment out t.Write(j.ToString) and keep working your way up until you can compile w/out errors?

its the line

j=d

which according to the docs

(JSONItem — Xojo documentation)

Var d As New Dictionary
d.Value("Name") = "John Doe"
d.Value("Age") = 32
d.Value("Married") = True
d.Value("Spouse") = "Jane Doe"

Var j As JSONItem
j = d

is fine for both windows and android but it will not compile in android .

Found a work around thanks William

will raise an issue