Log in or register to post comments

Book demo error on Unity 2017

August 1, 2017 - 6:32pm #1

I insert the book demo package and set my own keys in it.

When I scanned the image it showed

Error downloading json

UnityEngine.Debug:LogError(Object)

<LoadJSONBookData>c__Iterator0:MoveNext() (at Assets/scripts/ContentManager.cs:285)

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

I added a log on the json object.

Debug.Log(mJsonBookInfo.text);

And the object contain the json values.

{

  "title":"Principles of Computer Vision",

  "author":"Fernando Dines",

  "average rating":"4",

  "# of ratings":"30",

  "list price":"39.99",

  "your price":"21.99",

  "targetid":"95043ce3562046da82e7e0798b6e9660",

  "thumburl":"https://developer.vuforia.com/samples/cloudreco/thumbs/02_thumbnail.png",

  "bookurl":"https://developer.vuforia.com/samples/cloudreco/book2.html"

}

UnityEngine.Debug:Log(Object)

<LoadJSONBookData>c__Iterator0:MoveNext() (at Assets/scripts/ContentManager.cs:284)

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

Therefore, i assume the json is downloaded.

I do not know why it shows the error. please help!

Book demo error on Unity 2017

August 5, 2017 - 1:07am #3

hello,I can solve this problem.If the download is success,error will return null or an empty string.But some platforms don't allow empty string.So it's  better to use String.IsNullOrEmpty to check the error.In this case,you should change  mJsonBookInfo.error==null and  mBookThumb.error==null  to  string.IsNullOrEmpty(mJsonBookInfo.error) and string.IsNullOrEmpty(mBookThumb.error).

Book demo error on Unity 2017

August 2, 2017 - 11:50am #2

Hello vichanws,

We cannot guarantee the current samples will work on the 2017 versions of Unity as our focus is on the native integration of Vuforia with Unity. Any updates on the samples for Unity 2017 will be announced as they are ready.

In the mean time, I have confirmed that the book sample you are using works as intended with Unity 5.6. Are you able to use this version of Unity?

Thanks and sorry for the inconvenience,

-Vuforia Support

Log in or register to post comments