Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"GenericArguments[0], 'SystemMessageTest', on 'Google.ProtocolBuffers.IBuilderLite`2[TMessage,TBuilder]' violates the constraint of type parameter 'TMessage'." #100

Open
BrokenHell opened this issue May 28, 2015 · 3 comments

Comments

@BrokenHell
Copy link

What steps will reproduce the problem?
1.Build a simple .proto file then convert into .cs file ( simple .proto file can just be a simple class with single data )
2.Import into Unity project ( with .cs file and .dll file for windows phone 8 ) - Unity v5.0.2p1
3.Build Unity project into Windows phone 8 project
4.Run on device in RELEASE mode => see it crashed.

error_6
error_1
error_2
error_3

I cant see the whole stack trace since everything is "Null" the only message I got from debug data is this
"GenericArguments[0], 'SystemMessageTest', on 'Google.ProtocolBuffers.IBuilderLite`2[TMessage,TBuilder]' violates the constraint of type parameter 'TMessage'."

But by doing exactly my step will get you guys there . ( dont run in Debug mode since it will be ok , run in Release mode instead )

Thanks.

@BrokenHell
Copy link
Author

I manage to get the full stack trace here

  •   $exception  {System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'WinRTBridge.WinRTBridge' threw an exception. ---> System.TypeInitializationException: The type initializer for 'WinRTBridge.TypeInformation' threw an exception. ---> System.TypeLoadException: GenericArguments[0], 'SystemMessageTest', on 'Google.ProtocolBuffers.IBuilderLite`2[TMessage,TBuilder]' violates the constraint of type parameter 'TMessage'.
    
    at UnityEngineInternal.BootstrapHelpers.FillTypeMaps(Dictionary2& typeToTypeIdMap, List1& typeIdToTypeMap)
    at WinRTBridge.TypeInformation..cctor()
    --- End of inner exception stack trace ---
    at WinRTBridge.WinRTBridge..cctor()
    --- End of inner exception stack trace ---
    at WinRTBridge.WinRTBridge.set_Control(Object value)
    at NPlayTest.MainPage..ctor()
    --- End of inner exception stack trace ---
    at System.Windows.Navigation.PageResourceContentLoader.EndLoad(IAsyncResult asyncResult)
    at System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result)
    at System.Windows.Navigation.PageResourceContentLoader.BeginLoad_OnUIThread(AsyncCallback userCallback, PageResourceContentLoaderAsyncResult result)
    at System.Windows.Navigation.PageResourceContentLoader.<>c__DisplayClass4.b__0(Object args)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Delegate.DynamicInvokeImpl(Object[] args)
    at System.Windows.Threading.DispatcherOperation.Invoke()
    at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)
    at System.Windows.Threading.Dispatcher.OnInvoke(Object context)
    at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args)
    at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam* pParams, ScriptParam* pResult)} System.Exception {System.Reflection.TargetInvocationException}

@jskeet
Copy link
Owner

jskeet commented May 28, 2015

Without knowing anything about UnityEngineInternal.BootstrapHelpers.FillTypeMaps, it's hard for me to do anything else with this issue, I'm afraid.

(I've never advertised Unity as a supported platform for Protocol Buffers, and I've never used it myself. I'm not going to install it just to chase down this problem - particularly not right now, as I'm on holiday at the moment.)

As mentioned elsewhere, you could try applying ironhidegames/protobuf@83bcfef - but it's not clear that it's the same issue that that one fixes.

I suggest you contact Unity support about this - they're more likely to know about the quirks of Mono at that particular version and running on iOS than I do.

@BrokenHell
Copy link
Author

Ok I had fix this via Unity side , it is not because of Protocol buffer .

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants