Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MonoDevelop settings to fix "ran out of trampolines type 2" error

we are developing an iOS app. When we tested the app on PC, everything works well but when we ran it on a iPad/iPhone4 we frequently receive the "Ran out of Trampolines type 2" error message and the app crash. We have been spending the last few days trying to identify the cause/fix it and tried all the suggestions we have find on the net, we still have not made any progress. The only solution we have found are from the posts/webpages talking about the adjusting the trampoline settings with compiler settings like this: -aot "nrgctx-trampolines=4048" -aot "nimt-trampolines=4048" in monotouch. But we are using Unity3D to develop our app so we don't have this compiler option exposed to us. But I believe both Monotouch and Unity3D are based on the Mono framework so I'm guessing the same compiler settings can be applied to our unity3D project as well?

Does anyone know if this is correct? if yes, would anyone be able to give me some instructions on how to enable this option in our Unity3D project?

Thanks a lot in advance!

like image 950
Richard Avatar asked Apr 08 '11 06:04

Richard


2 Answers

The current Unity3D version supports AOT compiler command line options. Here is a solution for the problem: Unity Serializer, Mono and Trampolines!

like image 73
sloopidoopi Avatar answered Oct 28 '22 01:10

sloopidoopi


Trampolines would require some kind of code generation, and iOS forbids code generation on the fly.

But it's possible that I'm wrong, and trampolines can be prebuilt, for known calls. If such is the case, then please go to your Unity folder (Mac OS X paths here), and check these two shell scripts:

/Applications/Unity/Unity.app/Contents/Frameworks/Mono/bin/build /Applications/Unity/Unity.app/Contents/Frameworks/Mono/bin/xbuild

They should be calling ./xbuild.exe. Though they might be others, please do a grep on them:

/Applications/Unity/Unity.app/Contents/Frameworks/Mono/bin $ grep -ri '.exe \"$@\"' .

Better off, I think there was "stackOverflow" unity based group, not sure about it's name though.

like image 1
malkia Avatar answered Oct 28 '22 03:10

malkia