Bug 5693 - Error MT2002: Can not resolve reference: System.IntPtr MonoTouch.Foundation.NSString::CreateNative(System.String) (MT2002) (ios)
Summary: Error MT2002: Can not resolve reference: System.IntPtr MonoTouch.Foundation.N...
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-06-16 21:14 UTC by Omri Gazitt
Modified: 2012-09-11 10:14 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Omri Gazitt 2012-06-16 21:14:37 UTC
When upgrading from MT 5.2.11 to 5.2.12, I started getting a compiler error complaining about resolving NSString::CreateNative.

The code compiles cleanly for the Debug|iPhoneSim environment but fails to compile for Release|iPhone.

I don't use this method in my code anywhere - in fact I hardly ever use NSString at all (the only places my code explicitly creates an NSString is for CellKey's in some custom Elements I created based on the code in MT.Dialog). 

The build output is enclosed below, although I couldn't glean any additional insight from it...

----

Building Solution: ios (Release|iPhone)

Building: ClientEntities-ios (Release|iPhone)
Performing main compilation...
/Developer/MonoTouch/usr/bin/smcs /noconfig "/out:/Users/ogazitt/zaplify/bin/iPhone/Release/BuiltSteady.Zaplify.Devices.ClientEntities.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Runtime.Serialization.dll" /nologo /warn:4 /optimize- /codepage:utf8 "/define:CLIENT;IOS"  /t:library "/Users/ogazitt/zaplify/source/devices/shared/cliententities/About.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/ActionType.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/Color.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/Constants.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/Field.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/FieldValue.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/Folder.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/Item.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/ItemTag.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/ItemType.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/Permission.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/Priority.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/Tag.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/User.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/properties/AssemblyInfo.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/ClientEntity.cs" "/Users/ogazitt/zaplify/source/shared/entities/EntityConstants.cs" "/Users/ogazitt/zaplify/source/devices/shared/cliententities/Link.cs" 
Compilation succeeded - 1 warning(s)

/Users/ogazitt/zaplify/source/shared/entities/EntityConstants.cs(451,18): warning CS0219: The variable `user' is assigned but its value is never used


Build complete -- 0 errors, 1 warning

Building: ClientHelpers-ios (Release|iPhone)
Performing main compilation...
/Developer/MonoTouch/usr/bin/smcs /noconfig "/out:/Users/ogazitt/zaplify/bin/iPhone/Release/Utilities.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Runtime.Serialization.dll" "/r:/Users/ogazitt/zaplify/source/packages/Newtonsoft.Json.4.0.5/lib/mono/Newtonsoft.Json.MonoTouch.dll" "/r:/Users/ogazitt/zaplify/bin/iPhone/Release/BuiltSteady.Zaplify.Devices.ClientEntities.dll" /nologo /warn:4 /optimize- /codepage:utf8 "/define:IOS"  /t:library "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/CollectionHelper.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/HttpWrappers-ios.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/IsolatedStorageSettings-ios.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/RequestQueue.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/StorageHelper.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/TraceHelper.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/WebServiceHelper.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/properties/AssemblyInfo.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/DataContractJsonSerializer-ios.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/AppResourcesHelper.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/ClientSettingsHelper.cs" "/Users/ogazitt/zaplify/source/devices/shared/clienthelpers/ListMetadataHelper.cs" 
Build complete -- 0 errors, 0 warnings

Building: ClientViewModels-ios (Release|iPhone)
Performing main compilation...
/Developer/MonoTouch/usr/bin/smcs /noconfig "/out:/Users/ogazitt/zaplify/bin/iPhone/Release/BuiltSteady.Zaplify.Devices.ClientViewModels.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Runtime.Serialization.dll" "/r:/Users/ogazitt/zaplify/bin/iPhone/Release/BuiltSteady.Zaplify.Devices.ClientEntities.dll" "/r:/Users/ogazitt/zaplify/bin/iPhone/Release/Utilities.dll" /nologo /warn:4 /optimize- /codepage:utf8 "/define:IOS"  /t:library "/Users/ogazitt/zaplify/source/devices/shared/clientviewmodels/MainViewModel.cs" "/Users/ogazitt/zaplify/source/devices/shared/clientviewmodels/properties/AssemblyInfo.cs" 
Build complete -- 0 errors, 0 warnings

Building: iphone (Release|iPhone)

Detecting signing identity...
Provisioning profile: "iOS Team Provisioning Profile: *" (D1501662-F458-4A3C-95A5-7B860D241645)
Signing Identity: "iPhone Developer: Omri Gazitt (Y4TW3JY3C3)"
App ID: "UM4S76ZSNX.iphone"
Performing main compilation...
/Developer/MonoTouch/usr/bin/smcs /noconfig "/out:/Users/ogazitt/zaplify/bin/iPhone/Release/zaplifyiphone.exe" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/MonoTouch.Dialog-1.dll" "/r:/Users/ogazitt/zaplify/source/packages/Nuance.SpeechKit.1.0.1/lib/mono/SpeechKitLibraryBinder.dll" "/r:/Users/ogazitt/zaplify/source/packages/Newtonsoft.Json.4.0.5/lib/mono/Newtonsoft.Json.MonoTouch.dll" "/r:/Users/ogazitt/zaplify/source/packages/Xamarin.Mobile.0.4/lib/mono/Xamarin.Mobile.dll" "/r:/Users/ogazitt/zaplify/bin/iPhone/Release/BuiltSteady.Zaplify.Devices.ClientEntities.dll" "/r:/Users/ogazitt/zaplify/bin/iPhone/Release/Utilities.dll" "/r:/Users/ogazitt/zaplify/bin/iPhone/Release/BuiltSteady.Zaplify.Devices.ClientViewModels.dll" /nologo /warn:4 /optimize- /codepage:utf8 "/define:IOS"  /t:exe "/Users/ogazitt/zaplify/source/devices/ios/iphone/Main.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/FoldersViewController.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/FoldersViewController.designer.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/ListViewController.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/ListViewController.designer.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/MoreViewController.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/MoreViewController.designer.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/App.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/DebugPage.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/ItemPage.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/RadioEventElement.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/StyledHtmlElement.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/ButtonListElement.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/DateEventElement.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/SettingsPage.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/UIColorHelper.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/UIImageButton.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/MessageBox.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/UICheckbox.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/AddPage.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/MultilineEntryElement.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/NuanceHelper-ios.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/ListPickerPage.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/CheckboxImageElement.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/FolderEditor.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/ListEditor.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/SchedulePage.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/ThemedRootElement.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/ItemTypePickerElement.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/ParentListPickerElement.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/MailHelper.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/ContactPickerHelper.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/controls/DummyElement.cs" "/Users/ogazitt/zaplify/source/devices/ios/iphone/UIImageCache.cs" 
Compilation succeeded - 2 warning(s)

warning CS0618: `MonoTouch.Dialog.Section.Add(System.Collections.Generic.IEnumerable<MonoTouch.Dialog.Element>)' is obsolete: `Please use AddAll since this version will not work in future versions of MonoTouch when we introduce 4.0 covariance'
warning CS0618: `MonoTouch.Dialog.Section.Add(System.Collections.Generic.IEnumerable<MonoTouch.Dialog.Element>)' is obsolete: `Please use AddAll since this version will not work in future versions of MonoTouch when we introduce 4.0 covariance'



Copying content files
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/first.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/first.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/first@2x.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/first@2x.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/second.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/second.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/second@2x.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/second@2x.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/20-gear2.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/20-gear2.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/33-cabinet.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/33-cabinet.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/redbutton.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/redbutton.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/greenbutton.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/greenbutton.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/appbar.overflowdots.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/appbar.overflowdots.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/66-microphone.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/66-microphone.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/80-shopping-cart.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/80-shopping-cart.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/83-calendar.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/83-calendar.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/117-todo.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/117-todo.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/appbar.folder.rest.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/appbar.folder.rest.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/contact.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/contact.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/checkbox.off.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/checkbox.off.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/checkbox.on.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/checkbox.on.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/179-notepad.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/179-notepad.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/180-stickynote.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/180-stickynote.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/silverbutton.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/silverbutton.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/darkglassbutton.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/darkglassbutton.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/darkgreybutton.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/darkgreybutton.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/uiglassbutton-template.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/uiglassbutton-template.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/background@2x.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/background@2x.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/background.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/background.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/zaplify-logo-ipad.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/zaplify-logo-ipad.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/zaplify-logo-iphone.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/zaplify-logo-iphone.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Default.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Default.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Default@2x.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Default@2x.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/zaplify-logo-iphone@2x.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/zaplify-logo-iphone@2x.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/zaplify-launch-image-iphone.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/zaplify-launch-image-iphone.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/zaplify-launch-image-iphone@2x.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/zaplify-launch-image-iphone@2x.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/actions-back-button.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/actions-back-button.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/actions-back-button-selected.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/actions-back-button-selected.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/appbar.sort.rest.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/appbar.sort.rest.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/location2.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/location2.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/location.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/location.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/18-envelope.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/18-envelope.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/187-pencil.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/187-pencil.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/shoppingitem.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Images/shoppingitem.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/zaplify-logo-iphone.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/zaplify-logo-iphone.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/zaplify-logo-ipad.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/zaplify-logo-ipad.png'
Copying '/Users/ogazitt/zaplify/source/devices/ios/iphone/Images/zaplify-logo-iphone@2x.png' to '/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/zaplify-logo-iphone@2x.png'
Build complete -- 0 errors, 2 warnings

Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Developer" -v --nomanifest --nosign -dev "/Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app" -r "/Users/ogazitt/zaplify/bin/iPhone/Release/BuiltSteady.Zaplify.Devices.ClientEntities.dll" -r "/Users/ogazitt/zaplify/bin/iPhone/Release/Utilities.dll" -r "/Users/ogazitt/zaplify/bin/iPhone/Release/BuiltSteady.Zaplify.Devices.ClientViewModels.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/MonoTouch.Dialog-1.dll" -r "/Users/ogazitt/zaplify/source/packages/Nuance.SpeechKit.1.0.1/lib/mono/SpeechKitLibraryBinder.dll" -r "/Users/ogazitt/zaplify/source/packages/Newtonsoft.Json.4.0.5/lib/mono/Newtonsoft.Json.MonoTouch.dll" -r "/Users/ogazitt/zaplify/source/packages/Xamarin.Mobile.0.4/lib/mono/Xamarin.Mobile.dll" -linksdkonly -sdk "5.0" -targetver "4.3" --llvm --armv7 "-aot" "nimt-trampolines=512" --gcc_flags "\"-F/Users/ogazitt/zaplify/source/devices/ios/iphone/../../../packages/Nuance.SpeechKit.1.0.1/lib/objc/\" \"-framework\" \"SpeechKit\" \"-framework\" \"SystemConfiguration\" \"-framework\" \"Security\" \"-framework\" \"AVFoundation\" \"-framework\" \"AudioToolbox\"" "/Users/ogazitt/zaplify/bin/iPhone/Release/zaplifyiphone.exe"
MonoTouch version 5.2.12 using framework: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk
Copied /Users/ogazitt/zaplify/bin/iPhone/Release/zaplifyiphone.exe to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/zaplifyiphone.exe
Copied /Developer/MonoTouch/usr/lib/mono/2.1/mscorlib.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/mscorlib.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/monotouch.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/System.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/Mono.Security.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Mono.Security.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/System.Core.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/System.Xml.dll
Copied /Users/ogazitt/zaplify/bin/iPhone/Release/Utilities.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Utilities.dll
Copied /Users/ogazitt/zaplify/bin/iPhone/Release/BuiltSteady.Zaplify.Devices.ClientEntities.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/BuiltSteady.Zaplify.Devices.ClientEntities.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.Runtime.Serialization.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/System.Runtime.Serialization.dll
Copied /Users/ogazitt/zaplify/source/packages/Newtonsoft.Json.4.0.5/lib/mono/Newtonsoft.Json.MonoTouch.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Newtonsoft.Json.MonoTouch.dll
Copied /Users/ogazitt/zaplify/bin/iPhone/Release/BuiltSteady.Zaplify.Devices.ClientViewModels.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/BuiltSteady.Zaplify.Devices.ClientViewModels.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/MonoTouch.Dialog-1.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/MonoTouch.Dialog-1.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.Json.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/System.Json.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.ServiceModel.Web.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/System.ServiceModel.Web.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.ServiceModel.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/System.ServiceModel.dll
Copied /var/folders/rx/vzwh8g8j0xg_p2lnpjpxbkjh0000gn/T/tmp49a8bb35.tmp/SpeechKitLibraryBinder.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/SpeechKitLibraryBinder.dll
Copied /Users/ogazitt/zaplify/source/packages/Xamarin.Mobile.0.4/lib/mono/Xamarin.Mobile.dll to /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app/Xamarin.Mobile.dll
Linking SDK only for assembly /Users/ogazitt/zaplify/bin/iPhone/Release/zaplifyiphone.exe into /Users/ogazitt/zaplify/bin/iPhone/Release/iphone.app
error MT2002: Can not resolve reference: System.IntPtr MonoTouch.Foundation.NSString::CreateNative(System.String)
Comment 1 Sebastien Pouliot 2012-06-17 11:10:07 UTC
Sometimes the debug and release builds differs (since they have separate options) and can cause issues. OTOH that's weird since the symbol exists and monotouch.dll comes from the "right" place.

Could you attach (easier to read / compare as attachments) both the build logs for Release (fail) and Debug (success) and also (before re-building) add "-v -v" to the "additional mtouch arguments" Project's options ?

Thanks!
Comment 2 Omri Gazitt 2012-06-19 14:33:18 UTC
I also suspected environmental issues and did more research on this.  I've been able to rule out the version upgrade as the cause for the issue.  This was a bit hard to test because I couldn't find any way to downgrade to 5.2.11 or a download for that version, but I was able to find the original DMG, and set up a .11 and .12 side-by-side (and set up a /Developer/MonoTouch soft-link to the version I want to test).  As an aside - it would be awesome if you guys could make this process easier - or at least have a download page for older MT versions..)

I discovered that my issue stems from an objective C static library that I created as a wrapper on top of the Nuance iOS SDK (which I compile through a binding library and link into my app). Specifically, I was trying to make the minimum version for my app by iOS 4.0, and I set the target version in Xcode to 4.0.  When I ran make on the makefile below, I got a binding library with an i386 portion that targets the 4.3 SDK but the device-arch portions target the 5.0 SDK.  Hence the difference in linker behavior.

I can fix this by removing the "iphonesimulator4.3" from the compile flags... but I still haven't achieved my goal of making this app target iOS 4.0 and above.

Do you have any advice on what the right steps would be?  I clearly need to get the iPhone 4.x SDK and get it installed, so I have the ability to link the ARM executable with the correct SDK.  

Stepping back, my ultimate goal is to build my app in such a way that it doesn't fail on downlevel (4.x) devices - when I target the 5.0 SDK, I've occasionally used iOS API's that are only available on 5.0 and I didn't realize this until a 4.x device experienced a failure.  Is it safe for me to simply run on the 4.3 simulator and assume that if the app runs correctly on it, that it will run correctly on a 4.x device?


Makefile for building the binding library below:
----

all: SpeechKitLibraryBinder.dll

libSpeechKitLibrary-i386.a:
        $(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphonesimulator4.3 -configuration Release clean build
        -mv $(PROJECT_ROOT)/build/Release-iphonesimulator/lib$(TARGET).a $@

libSpeechKitLibrary-armv6.a:
        $(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphoneos -arch armv6 -configuration Release clean build
        -mv $(PROJECT_ROOT)/build/Release-iphoneos/lib$(TARGET).a $@

libSpeechKitLibrary-armv7.a:
        $(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphoneos -arch armv7 -configuration Release clean build
        -mv $(PROJECT_ROOT)/build/Release-iphoneos/lib$(TARGET).a $@

libSpeechKitLibraryUniversal.a: libSpeechKitLibrary-armv7.a libSpeechKitLibrary-armv6.a libSpeechKitLibrary-i386.a
        lipo -create -output $@ $^

SpeechKitLibraryBinder.dll: AssemblyInfo.cs ApiDefinition.cs StructsAndEnums.cs libSpeechKitLibraryUniversal.a
        $(BTOUCH) -unsafe --outdir=tmp -out:$@ ApiDefinition.cs -x=StructsAndEnums.cs -x=AssemblyInfo.cs --link-with=libSpeechKitLibraryUniversal.a,libSpeechKitLibraryUniversal.a
        -mv $@ $(PACKAGES_ROOT)
Comment 3 Sebastien Pouliot 2012-06-19 17:31:14 UTC
> it would be awesome if you guys could make this process easier

With recent version of MT and MD you can set your MonoDevelop's preferences (SDK Location) to point to a different directory for your MonoTouch SDK (it requires a restart of MD right now to take effect).

> or at least have a download page for older MT versions..)

You should have access to them from your Xamarin store account page.

> Hence the difference in linker behaviour.

I do not see how this could affect the (managed) linker since it's being executed way earlier than the native linker (which has to deal with different architectures). Even if the bindings comes from another project this should change the availability of what's inside monotouch.dll.

Is the original issue something you can duplicate again ?

> Is it safe for me to simply run on the 4.3 simulator and assume that
> if the app runs correctly on it, that it will run correctly on a 4.x device?

Not totally safe. New APIs were added in 4.1 to 4.3 (4.2 had a lot for the iPad) and they would run ok on the simulator while failing on a 4.0 device.

The safest way would be to have an old device running iOS 4.x (where x is the minimum you want to support) and test your application on the device.
Comment 4 Omri Gazitt 2012-06-19 18:27:50 UTC
Thanks Poupou, this is all great information.

I can duplicate the issue, but creating a tight repro will be difficult / time-consuming, since there are many moving parts - the Nuance SDK (delivered as an iOS framework), the objective C wrapper that creates a static lib which links with the framework, the binding library I create for that static lib, and of course my app itself.  I am happy to privately send the entire solution over if that will help...
Comment 6 Sebastien Pouliot 2012-06-20 16:38:05 UTC
So I had the "chance" to see something similar. What happened is that a binding was made with MonoTouch 5.3.x (unstable) and then the binary was reused with 5.2 (stable).

The new (5.3) MonoTouch introduce CreateNative as a way to be more efficient in string handling. However it is not backward compatible with earlier MT (<= 5.2) release.

Could this be what's happening in your case ? because you should not see NSString.CreateNative with either 5.2.11 or 5.2.12 (but it could come from a 3rd party bindings, not your own code).
Comment 7 Omri Gazitt 2012-06-20 20:38:51 UTC
Ah, that may be the issue - I briefly installed the 5.3.x (alpha) release to test out whether the issue I found with OrderBy value-type LINQ expressions was fixed (which it was).  Perhaps I didn't do a clean build in when I switched back to the stable builds?

But I am confident that the most recent builds I did were in fact clean builds, and that I ran btouch to build the binding lib with the same mono build that I later ran mtouch with (to build the app).

I will experiment with this some more... Have a great vacation!
Comment 8 Sebastien Pouliot 2012-09-11 10:14:15 UTC
MT 5.4 (stable) is released and have the CreateNative method so this should not be an issue anymore (with old or newer bindings).