iOS Link Failed

Hi…

Hope someone can help me here… Under 2015r2.1 I cannot Build or Run my iOS app… This is the error I am getting:

Thanks

Process: Regatta Manager Assistant.debug [12668]
Path: /Users/USER/Library/Developer/CoreSimulator/Devices/D761157E-B98F-4A36-B180-6391DE42DB51/data/Containers/Bundle/Application/2C35B6B6-6A9E-4FD9-A8FA-E6D6AEA66F8E/Regatta Manager Assistant.debug.app/Regatta Manager Assistant.debug
Identifier: Regatta Manager Assistant.debug
Version: ???
Code Type: X86 (Native)
Parent Process: launchd_sim [12534]
Responsible: launchd_sim [12534]
User ID: 501

Date/Time: 2015-05-14 16:08:14.576 -0400
OS Version: Mac OS X 10.10.3 (14D136)
Report Version: 11
Anonymous UUID: A745703D-3927-47F4-F902-B61595753CA6

Sleep/Wake UUID: C87D5A41-694A-4D80-AC59-FC0B62162A75

Time Awake Since Boot: 360000 seconds
Time Since Wake: 35000 seconds

Crashed Thread: 0

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000

Application Specific Information:
dyld: launch, loading dependent libraries
DYLD_SHARED_REGION=avoid
DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks
DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks
DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib

Dyld Error Message:
Library not loaded: /System/Library/Frameworks/Cocoa.framework/Cocoa
Referenced from: /Users/USER/Library/Developer/CoreSimulator/Devices/D761157E-B98F-4A36-B180-6391DE42DB51/data/Containers/Bundle/Application/2C35B6B6-6A9E-4FD9-A8FA-E6D6AEA66F8E/Regatta Manager Assistant.debug.app/Regatta Manager Assistant.debug
Reason: no suitable image found. Did find:
/System/Library/Frameworks/Cocoa.framework/Cocoa: mach-o, but not built for iOS simulator

Binary Images:
0x228000 - 0x24c44b +dyld_sim (353.2.1) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/dyld_sim
0x8fedd000 - 0x8ff10e03 dyld (353.2.1) <06B1254D-9BB9-327C-BA15-8F18FFF97586> /usr/lib/dyld

You have some declares with a lib of “Cocoa”. Cocoa is not available in iOS so the linking failed. If you change them to reference the proper library (probably UIKit or Foundation) then it should link properly.

Thanks Jason…

The problem code is right from the “Speak” sample project… and it worked fine under builds using previous versions of Xojo… My app using it was even approved… Here is that code:

// #import <AVFoundation/AVFoundation.h>
//
// AVSpeechSynthesizer *av = [[AVSpeechSynthesizer alloc] init];
// AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc]initWithString:@“Text to say”];
// [av speakUtterance:utterance];

// https://developer.apple.com/library/ios/Documentation/AVFoundation/Reference/AVSpeechUtterance_Ref/index.html#//apple_ref/occ/instm/AVSpeechUtterance/initWithString:
// https://developer.apple.com/library/ios/Documentation/AVFoundation/Reference/AVSpeechSynthesizer_Ref/index.html#//apple_ref/occ/instm/AVSpeechSynthesizer/speakUtterance:

// Common Declares
Declare Function alloc Lib “Foundation” selector “alloc” (classRef As Ptr) As Ptr
Declare Function NSClassFromString Lib “Foundation” (classname As CFStringRef) As Ptr

// Create an utterance instance with the specified text
// AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc]initWithString:@“Text to say”];
Static AVSpeechUtterance As Ptr = NSClassFromString(“AVSpeechUtterance”)
Dim utterance As Ptr = alloc(AVSpeechUtterance)

Declare Function initUtterance Lib “Cocoa” Selector “initWithString:” (id As Ptr, theText As CFStringRef ) As Ptr
Dim initPtr As Ptr = initUtterance(utterance, SpeakArea.Text)

// Create an instance of AVSpeechSynthesizer
// AVSpeechSynthesizer *av = [[AVSpeechSynthesizer alloc] init];
Declare Function init Lib “Cocoa” Selector “init” (id As Ptr) As Ptr

Static AVSpeechSynthesizer As Ptr = NSClassFromString(“AVSpeechSynthesizer”)
Dim synthesizer As Ptr = init(alloc(AVSpeechSynthesizer))

// Speak the utterance
// [av speakUtterance:utterance];
Declare Sub speakUtterance Lib “Cocoa” Selector “speakUtterance:” (id As Ptr, utterance As Ptr )
speakUtterance(synthesizer, initPtr)

These are the culprits. Xojo fixed the compiler so it respects the library instead of allowing anything to go, and this causes projects like yours to fail when the lib doesn’t exist. You can fix those declares by making the lib “AVFoundation.framework”.

Thanks again… I will try that…

And I guess Paul needs to fix the example project…

It has been updated for 2015r3.