我正在使用Monotouch的RedLaser绑定来创建一个扫描条形码的应用程序。它像iSimulator上的魅力一样好用,但是当我尝试部署到真实设备(切换运行环境Debug | Simulator - > Debug | iPhone)时,我甚至无法构建。
我使用的是MonoTouch 6.0.8,MonoDevelop 3.0.6,XCode 4.5.2。
另外,我正在使用iphone 3GS设备进行部署。该设备运行的是iOS 6.0,这就是我的应用程序的目标。我在MonoTouch bugzilla上发现了一个错误,该错误具有相同的错误代码here,建议将目标从6.0更改为> 5.1。我这样做并没有改变一件事。
我的配置文件已在Xcode Organizer上设置,验证并安装,并且与证书相同。我可以看到两者都很好。
构建输出如下,任何帮助都将受到高度赞赏。 感谢
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++ -miphoneos-version-min = 5.1 -gdwarf-2 -arch armv7 -std = c99 -I / Developer / MonoTouch / SDKs / MonoTouch.iphoneos.sdk / usr / include -isysroot /Applications/Xcode.app/Contents/Developer/平台/ iPhoneOS.platform /开发商/软件开发工具包/ iPhoneOS6.0.sdk -c /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/main.armv7.m -o /Users/hasnainaltaiar/Dev/Leopard/SVN/trunk/LD6419/Platforms/iOS/Leopard.Delivery.iOS/Leopard.Delivery.iOS/obj/Release/mtouch-cache/main..armv7.cache.M0wr77LlBANF6vKjGqQvyVnmWEk=的.o /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++ -miphoneos-version-min = 5.1 -gdwarf-2 -arch armv7 -std = c99 -I / Developer / MonoTouch / SDKs / MonoTouch.iphoneos.sdk / usr / include -isysroot /Applications/Xcode.app/Contents/Developer/平台/ iPhoneOS.platform /开发商/软件开发工具包/ iPhoneOS6.0.sdk -c /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/registrar.m -o /Users/hasnainaltaiar/Dev/Leopard/SVN/trunk/LD6419/Platforms/iOS/Leopard.Delivery.iOS/Leopard.Delivery.iOS/obj/Release/mtouch-cache/registrar.armv7.cache.Zar9bxp0AZNxwVcgrsOMEFHv0k4=。 Ø /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++ -Wl,-no_pie -miphoneos-version-min = 5.1 -gdwarf-2 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/Mono.Security.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/Leopard.Domain.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/RedLaser.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/System.Core.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/mscorlib.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/System.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/monotouch.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/LeopardDeliveryiOS.exe.armv7.o /Users/hasnainaltaiar/Dev/Leopard/SVN/trunk/LD6419/Platforms/iOS/Leopard.Delivery.iOS/Leopard.Delivery.iOS/obj/Release/mtouch-cache/main..armv7.cache.M0wr77LlBANF6vKjGqQvyVnmWEk=.o /Users/hasnainaltaiar/Dev/Leopard/SVN/trunk/LD6419/Platforms/iOS/Leopard.Delivery.iOS/Leopard.Delivery.iOS/obj/Release/mtouch-cache/registrar.armv7.cache.Zar9bxp0AZNxwVcgrsOMEFHv0k4=.o -o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/LeopardDeliveryiOS -framework CFNetwork -framework Foundation-framework UIKit -framework AudioToolbox -framework QuartzCore -framework CoreGraphics -framework AVFoundation -framework CoreMedia -framework CoreVideo -framework OpenGLES -framework Security -framework SystemConfiguration -lz -liconv -u _mono_pmip -u _monotouch_create_managed_ref -u _monotouch_release_managed_ref -u _monotouch_IntPtr_objc_msgSend_IntPtr -u _monotouch_IntPtr_objc_msgSendSuper_IntPtr -u _CloseZStream -u _CreateZStream -u _Flush -u _ReadZStream -u _WriteZStream -lmono-2.0 -lmonotouch -L /开发商/ MonoTouch的/的SDK / MonoTouch.iphoneos .sdk / usr / lib -lgcc_eh -force_load /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/libRedLaserSDK.a 进程退出代码1,命令: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++ -Wl,-no_pie -miphoneos-version-min = 5.1 -gdwarf-2 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/Mono.Security.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/Leopard.Domain.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/RedLaser.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/System.Core.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/mscorlib.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/System.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/monotouch.dll.armv7.o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/LeopardDeliveryiOS.exe.armv7.o /Users/hasnainaltaiar/Dev/Leopard/SVN/trunk/LD6419/Platforms/iOS/Leopard.Delivery.iOS/Leopard.Delivery.iOS/obj/Release/mtouch-cache/main..armv7.cache.M0wr77LlBANF6vKjGqQvyVnmWEk=.o /Users/hasnainaltaiar/Dev/Leopard/SVN/trunk/LD6419/Platforms/iOS/Leopard.Delivery.iOS/Leopard.Delivery.iOS/obj/Release/mtouch-cache/registrar.armv7.cache.Zar9bxp0AZNxwVcgrsOMEFHv0k4=.o -o /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/LeopardDeliveryiOS -framework CFNetwork -framework Foundation-framework UIKit -framework AudioToolbox -framework QuartzCore -framework CoreGraphics -framework AVFoundation -framework CoreMedia -framework CoreVideo -framework OpenGLES -framework Security -framework SystemConfiguration -lz -liconv -u _mono_pmip -u _monotouch_create_managed_ref -u _monotouch_release_managed_ref -u _monotouch_IntPtr_objc_msgSend_IntPtr -u _monotouch_IntPtr_objc_msgSendSuper_IntPtr -u _CloseZStream -u _CreateZStream -u _Flush -u _ReadZStream -u _WriteZStream -lmono-2.0 -lmonotouch -L /开发商/ MonoTouch的/的SDK / MonoTouch.iphoneos .sdk / usr / lib -lgcc_eh -force_load /var/folders/_l/0pvrtd6x6qg83sz4_0906b5c0000gn/T/tmpee06e1f.tmp/libRedLaserSDK.a 架构armv7的未定义符号:
" _OBJC_CLASS _ $ _ CLLocationManager",引自: libRedLaserSDK.a中的objc-class-ref(StatusManager.o)ld:找不到架构armv7的符号collect2:ld返回1 退出状态错误MT5202:原生链接失败。请查看构建日志。
----------------------完成----------------------
项目没有指定包标识符。产生 ' leoparddeliveryios'匹配配置文件。
答案 0 :(得分:4)
从错误消息:
Undefined symbols for architecture armv7: "_OBJC_CLASS_$_CLLocationManager"
图书馆似乎已更新,现在依赖于CoreLocation
。
编辑绑定项目中的[LinkWith]
属性,并将CoreLocation
添加到它的Frameworks
属性,然后重建绑定(然后重建您的应用程序)。如果这样可以解决问题,请提交错误报告,以便在github存储库中修复。
注意:作为快速测试,您还可以将以下选项添加到项目的Debug 和 Release配置中(在 mtouch其他参数中< / strong>在MonoDevelop中的项目选项中。
-gcc_args="-framework CoreLocation"
这将导致相同的结果 - 除非您需要为您正在使用的每个项目(和配置)复制该修复程序(因此发现问题非常有用,但不是一个非常好的修复方法)。 / p>
答案 1 :(得分:2)
好的,我解决了这个问题,但会在此处记录解决方案,以分享所吸取的教训。
首先:它无法构建解决方案,因为绑定时CoreLocation
属性中缺少Frameworks
。感谢poupou指出这一点,我也在GitHub(MonoTouch Binding Repo)上修复了它。
第二:MonoDevelop无法构建应用,因为它找不到配置文件。您需要手动设置配置文件和证书。您可以转到Main Project > Options > Build > iPhone Bundle Signing
&gt;然后,您选择Configuration (Debug|Release)
和Platform (iPhone|Simulator)
,并为Identity和Prov选择您的证书和配置文件。轮廓。
第三:最后,每次我部署到iPhone时,应用程序都崩溃了。我提交了上面评论中提到的错误。然后看来RedLaser框架在扫描QRCodes时有一个错误。通过添加以下行禁用此功能,修复了问题。
overlayController.ParentPicker.ScanQRCODE = false;