2012-06-04 2 views
0

here과 비슷한 오류가 발생합니다.MonoTouch에서 JSON.Net을 사용한 이상한 예외

저는 JSON과 JSON을 백그라운드 스레드에서 구문 분석합니다. 간헐적으로 오류가 발생하여 Array.Copy 오류가 발생합니다.

다음
System.NullReferenceException: Object reference not set to an instance of an object 
    at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, System.Array destinationArray, Int32 destinationIndex, Int32 length) [0x00104] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Array.cs:979 
    at System.Collections.ArrayList.CopyTo (Int32 index, System.Array array, Int32 arrayIndex, Int32 count) [0x0002d] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Collections/ArrayList.cs:3064 
    at System.Collections.ArrayList.CopyTo (System.Array array, Int32 arrayIndex) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Collections/ArrayList.cs:3046 
    at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x0026c] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/MonoCustomAttrs.cs:259 
    at System.MonoType.GetCustomAttributes (System.Type attributeType, Boolean inherit) [0x00011] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/MonoType.cs:582 
    at Newtonsoft.Json.Utilities.ReflectionUtils.GetAttributes[JsonConverterAttribute] (ICustomAttributeProvider attributeProvider, Boolean inherit) [0x00000] in <filename unknown>:0 
    at Newtonsoft.Json.Utilities.ReflectionUtils.GetAttribute[JsonConverterAttribute] (ICustomAttributeProvider attributeProvider, Boolean inherit) [0x00000] in <filename unknown>:0 
    ... Continues ... 

가 JSON.Net에서 잘못된 코드입니다 : 내가 GetCustomAttributes가 null 반환 같은데요

#if !(NETFX_CORE) 
    public static T[] GetAttributes<T>(ICustomAttributeProvider attributeProvider, bool inherit) where T : Attribute 
    { 
     ValidationUtils.ArgumentNotNull(attributeProvider, "attributeProvider"); 

     object provider; 

#if !PORTABLE 
     provider = attributeProvider; 
#else 

... omitted junk ... 

     if (provider is Type) 
     return (T[])((Type)provider).GetCustomAttributes(typeof(T), inherit); 

여기

는 스택 트레이스이다. Xamarin의 누군가가이 문제를 알고 있었습니까? 뉴스 그룹의 한 관계자는이 작업을 주 스레드에 넣었다 고 말하면서 그것을 수정했다 (그러나 나는 그것을하고 싶지 않다).

+0

JSON 모양이 어떻게됩니까? –

+0

이것은 다음과 같습니다 : { "ErrorCode": 660, "ErrorMessage": "GameId는 현재 라운드가 아닙니다."} – jonathanpeppers

답변

2

이것은 known bug입니다.

5.3.3 알파 릴리스에서 수정되었습니다.

+0

앱에서 5.3.3을 사용 해본 적이 있습니까? 전환 하겠지만 다음 2 주 내에 앱 스토어가 출시 될 수 있습니다. ('알파'라는 단어가 무서워서) – jonathanpeppers

+0

나는 TestFlight 사용자들에게 그것을 공개하고 그것이 어떻게 진행되는지 볼 것입니다. 문제가 해결되면 답을 표시하십시오. – jonathanpeppers