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

Could not get it run on iOS device #186

Closed
o0160o opened this issue Sep 16, 2016 · 3 comments
Closed

Could not get it run on iOS device #186

o0160o opened this issue Sep 16, 2016 · 3 comments
Labels

Comments

@o0160o
Copy link

o0160o commented Sep 16, 2016

I wrote a test case like this.
Test.cs.zip
This it what i got:

Unhandled Exception: System.InvalidOperationException: An AOT error is occurred. MessagePackSerializer.PrepareType<System.Int32> is should be called in advance. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: An AOT error is occurred. MessagePackSerializer.PrepareType<System.Int32> is should be called in advance. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ExecutionEngineException: Attempting to call method 'MsgPack.Serialization.SerializationContext::GetSerializer' for which no ahead of time (AOT) code was generated.

I couldn't get it run on iOS device.
Do you have any suggestions? Thank you in advance!

@yfakariya
Copy link
Member

Sorry for delay.
Unfortunately, you must prepare all types you used except you use pre-generated serializers (which can do with mpu.exe).

I reproduced and then put following code, it worked well:

// start adding --
MsgPack.Serialization.MessagePackSerializer.PrepareType<int>();
MsgPack.Serialization.MessagePackSerializer.PrepareType<string>();
MsgPack.Serialization.MessagePackSerializer.PrepareType<AData>();
MsgPack.Serialization.MessagePackSerializer.PrepareType<BData>();
// -- end adding
MsgPack.Serialization.MessagePackSerializer.PrepareType<Dat>();

@o0160o
Copy link
Author

o0160o commented Sep 23, 2016

Thank you very much!

On Friday, September 23, 2016, Yusuke Fujiwara [email protected]
wrote:

Sorry for delay.
Unfortunately, you must prepare all types you used except you use
pre-generated serializers (which can do with mpu.exe).

I reproduced and then put following code, it worked well:

// start adding --
MsgPack.Serialization.MessagePackSerializer.PrepareType();
MsgPack.Serialization.MessagePackSerializer.PrepareType();
MsgPack.Serialization.MessagePackSerializer.PrepareType();
MsgPack.Serialization.MessagePackSerializer.PrepareType();// -- end adding
MsgPack.Serialization.MessagePackSerializer.PrepareType();


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#186 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AK7KXgXutl9h82Vs6LVMJs6k1dRQStgcks5qs6QngaJpZM4J-qId
.

@yfakariya
Copy link
Member

No problem!
I close this because it looks solved.

yfakariya added a commit that referenced this issue Sep 24, 2017
yfakariya added a commit that referenced this issue Sep 24, 2017
yfakariya added a commit that referenced this issue Sep 24, 2017
yfakariya added a commit that referenced this issue Sep 26, 2017
yfakariya added a commit that referenced this issue Sep 26, 2017
yfakariya added a commit that referenced this issue Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants