MonoTouch'无法组装'

时间:2013-03-08 03:52:32

标签: xamarin.ios

我正在使用MonoTouch 6.2,我有一个可以在模拟器上构建并运行良好的应用程序,但是当我为实际设备构建时,会出现“无法解决组件”错误。

有没有人见过这个?

这是编译器输出:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++  -miphoneos-version-min=4.3 -arch armv7  -std=c99 -I/Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -x assembler-with-cpp -c /var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/GoogleAnalytics.dll.armv7.s -o /var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/GoogleAnalytics.dll.armv7.o
AOT Compilation exited with code 134, command:
MONO_PATH=/Users/me/dev/MyApp/Src/Plat/iOS/bin/iPhone/Debug/MyApp.app /Developer/MonoTouch/usr/bin/arm-darwin-mono --debug --aot=mtriple=armv7-darwin,full,static,asmonly,direct-icalls,soft-debug,no-direct-calls,iphone-abi,outfile=/var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/MyApp.exe.armv7.s "/Users/me/dev/MyApp/Src/Plat/iOS/bin/iPhone/Debug/MyApp.app/MyApp.exe"
Mono Ahead of Time compiler - compiling assembly /Users/me/dev/MyApp/Src/Plat/iOS/bin/iPhone/Debug/MyApp.app/MyApp.exe
* Assertion at ../../../../../mono/mono/metadata/marshal.c:8613, condition `sig->param_count == invoke_sig->param_count + 1' not met


Mono Ahead of Time compiler - compiling assembly /Users/me/dev/MyApp/Src/Plat/iOS/bin/iPhone/Debug/MyApp.app/mscorlib.dll
Code: 1337720 Info: 35037 Ex Info: 487954 Unwind Info: 8707 Class Info: 22674 PLT: 3057 GOT Info: 65112 GOT: 22092 Offsets: 31427
Output file: '/var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/mscorlib.dll.armv7.s'.
Linking symbol: '_mono_aot_module_mscorlib_info'.
Compiled 6288 out of 6288 methods (100%)
Methods without GOT slots: 4052 (64%)
Direct calls: 246 (2%)
JIT time: 1134 ms, Generation time: 1793 ms, Assembly+Link time: 203 ms.

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++  -miphoneos-version-min=4.3 -arch armv7  -std=c99 -I/Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -x assembler-with-cpp -c /var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/mscorlib.dll.armv7.s -o /var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/mscorlib.dll.armv7.o
error MT3001: Could not AOT the assembly '/Users/me/dev/MyApp/Src/Plat/iOS/bin/iPhone/Debug/MyApp.app/MyApp.exe'
  at MTouch.GetObjectFileForAssembly (System.String assemblyName, Abi abi) [0x00000] in <filename unknown>:0 
  at MTouch+<CompileAssemblies>c__AnonStorey10.<>m__1A (System.String s) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey36`1[System.String].<>m__34 (System.String e, System.Threading.Tasks.ParallelLoopState s, System.Object l) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey35`2[System.String,System.Object].<>m__32 () [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.TaskActionInvoker+ActionInvoke.Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0

1 个答案:

答案 0 :(得分:1)

修复..问题是我有一个MonoPInvokeCallbackAttribute,其委托类型与函数的签名不匹配。例如:

delegate int SomeDelegate();

[ MonoPInvokeCallbackAttribute ( typeof( SomeDelegate ) ) ]
static void MyCallback( int x )
{
}

因此 SomeDelegate 的签名与 MyCallback 的签名不符。