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

Convert clr type System.MonoType error #165

Closed
cbeneyto opened this issue Nov 14, 2016 · 13 comments
Closed

Convert clr type System.MonoType error #165

cbeneyto opened this issue Nov 14, 2016 · 13 comments

Comments

@cbeneyto
Copy link

We are using Moonsharp Asset in our new game.

On Android works well. However in iOS in the DEV version there are no problems, but in the RELEASE version it does not run correctly.

We have the following error:

"ScriptRunTimeException: Can not convert clr type System.MonoType"

I repeat. We only get that error once it is released to the iTunes Store, not in Dev mode.

Any solution?

@cbeneyto
Copy link
Author

Hey @xanathar any help about it!? =)

@xanathar
Copy link
Member

No idea, and with this little context I can't be more of help. What script code was executing at the time ? What types was it trying to convert ?

@mariobarreiro
Copy link

Hi Xanathar

Basically we did the tutorial with LUA, which accesses C# classes. We guess that Apple doesn't like that in release mode, because without that, LUA is perfectly working.

Thanks!
Mario

@schotime
Copy link

We seem to be having similar weird issues in release mode (we can't reproduce on our workstation (debug mode)).

For us it has to do with Enums and Guids (error for guid below) at the moment.

It looks like it's sometimes not registering them properly or something. We had to pre create int versions of our enums because comparing them to an int in a LUA script would randomly fail, however it just work after we have changed the script?

We are using InteropAccessMode.Reflection.

Any thoughts as to why this could be happening @xanathar ??

MoonSharp.Interpreter.ScriptRuntimeException: cannot convert clr type System.Guid
   at MoonSharp.Interpreter.Interop.Converters.ClrToScriptConversions.ObjectToDynValue(Script script, Object obj) in Z:\git\my\moonsharp\src\MoonSharp.Interpreter\Interop\Converters\ClrToScriptConversions.cs:line 151
   at MoonSharp.Interpreter.Interop.BasicDescriptors.DispatchingUserDataDescriptor.TryIndex(Script script, Object obj, String indexName) in Z:\git\my\moonsharp\src\MoonSharp.Interpreter\Interop\BasicDescriptors\DispatchingUserDataDescriptor.cs:line 311
   at MoonSharp.Interpreter.Interop.BasicDescriptors.DispatchingUserDataDescriptor.Index(Script script, Object obj, DynValue index, Boolean isDirectIndexing) in Z:\git\my\moonsharp\src\MoonSharp.Interpreter\Interop\BasicDescriptors\DispatchingUserDataDescriptor.cs:line 235
   at MoonSharp.Interpreter.Execution.VM.Processor.ExecIndex(Instruction i, Int32 instructionPtr) in Z:\git\my\moonsharp\src\MoonSharp.Interpreter\Execution\VM\Processor\Processor_InstructionLoop.cs:line 1329
   at MoonSharp.Interpreter.Execution.VM.Processor.Processing_Loop(Int32 instructionPtr) in Z:\git\my\moonsharp\src\MoonSharp.Interpreter\Execution\VM\Processor\Processor_InstructionLoop.cs:line 279
   at MoonSharp.Interpreter.Execution.VM.Processor.Call(DynValue function, DynValue[] args) in Z:\git\my\moonsharp\src\MoonSharp.Interpreter\Execution\VM\Processor\Processor.cs:line 67

@schotime
Copy link

Update
So it turns out our issues where due to object being registered as a type. This causes some weird things to happen, due to the fact everything can be an object which meant everything just worked.

@qq1054599715
Copy link

qq1054599715 commented Jan 17, 2017

fuck ios release mode!
ios doesnt support this type:
class A{
public int content;
}
if you register class A and use it,then you will get issues!
all 8 base types dosent support to be ref in ios!

this issue killed me so much time
make sure dont use delegate and event in moonsharp whenever your app needs build to ios!

@rgarat
Copy link

rgarat commented Mar 9, 2017

What do you mean by it not working in the app store? if you build on unity using "Run in XCode" as Release, and with Development Build unchecked, does it fail? or does it only fail after its been uploaded to apple?

@mariobarreiro
Copy link

Yes, in our case it works perfectly until you upload it. Then you download de app with TestFlight and it doesn't work. Basically we had to move the tutorial code from LUA to C#. Our intention was to update the tutorial without updating the app, but it couldn't be.

@rgarat
Copy link

rgarat commented Mar 9, 2017

Wow, thats bad, we are using moonsharp as a scripting system for quests, dialogs, etc and finding out that nothing works when we upload it would be really really horrible.
Do you know what is actually the problem? I mean in which cases it fails and where it works? Does it all fail? or just when doing something particular?

@mariobarreiro
Copy link

No, we couldn't find the problem. Our Unity devs prepared a toolkit to manage a game tutorial with LUA but it didn't work after uploading to Apple.

@rgarat
Copy link

rgarat commented Mar 13, 2017

I am happy to report that at least with moonsharp 2 and Unity 5.5.2p1 we were able to upload a build of our app to testflight and use internal testing to download it and everything worked fine.

Not sure if there is something with older versions that was a problem, or if there is some special case that is not supported and we just aren't using that feature.

@unitycoder
Copy link

Just for reference also:
using 5.3.7p4 + moonsharp 2.0, local ios build worked fine, but had crashing with TestFlight and AppStore builds.. Solved by disabling [ ] include bitcode in xcode archive upload settings. (some details here)

@LimpingNinja
Copy link
Contributor

Based on comment, considered closed.

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

8 participants