Build problems with iPhoneExample

Discussion of the OCMock framework. If you have patches we would prefer you to send them to the mailing list, but attaching them to a topic is possible, too.

Build problems with iPhoneExample

Postby mgladdish » 02 Feb 2011, 12:54

Hi there. I've been following articles, instructions and topics on this board for clues, but can't seem to get the iPhoneExample project to work.
I am running XCode 3.2.5 and iOS 4.2.

I have had similar problems to other posters which also have been helped by downloading the source and using that. I am now trying to get the example iPhoneExample project to work (from trunk), but hitting the same problems I was in my own project.
I am trying to run the iPhoneExampleTesting target under debug on my device. The project builds fine, but I get the following error on the console window:

Code: Select all
Test Suite 'All tests' started at 2011-02-02 10:41:32 +0000
Test Suite '/var/mobile/Applications/1134A174-D63F-4126-9628-F77415A83A56/iPhoneExample.app/iPhoneExampleTests.octest(Tests)' started at 2011-02-02 10:41:32 +0000
Test Suite 'RootViewControllerTests' started at 2011-02-02 10:41:32 +0000
Test Case '-[RootViewControllerTests testControllerReturnsCorrectNumberOfRows]' started.
Test Case '-[RootViewControllerTests testControllerReturnsCorrectNumberOfRows]' passed (0.002 seconds).
Test Case '-[RootViewControllerTests testControllerSetsUpCellCorrectly]' started.
Program received signal:  “EXC_BAD_INSTRUCTION”.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
Xcode could not locate source file: OCMockObject.m (line: 71)


I have tried the -ObjC and -force_load linker flags suggested on other posts on this board, also to no avail.

Apologies as I'm new to Objective-C, but does anyone have any pointers as to where I can go from here to get this working?

Many thanks.
mgladdish
 
Posts: 2
Joined: 02 Feb 2011, 12:42
Location: London

Re: Build problems with iPhoneExample

Postby erik » 02 Feb 2011, 15:59

I'm really interested in resolving this. It seems the biggest problem with OCMock over the past year has been keeping up with the changes in the iOS dev environment. Either way, I double-checked and the iPhoneExample works for me. Not that this is much consolation for you.

With the latest version of OCMock (SVN r73), Xcode 3.2.5, and iOS 4.2.1 (8C148) on an iPad I get the following output. Can you compare to the full output you're getting to see whether there's anything suspicious?

Code: Select all
[Session started at 2011-02-02 14:53:32 +0100.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1510) (Fri Oct 22 04:12:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys004
Loading program into debugger…
warning: Couldn't get real path for inserted library /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/Library/PrivateFrameworks/DevToolsBundleInjection.framework/DevToolsBundleInjection

warning: Couldn't get real path for inserted library /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/Library/PrivateFrameworks/DevToolsBundleInjection.framework/DevToolsBundleInjection

Program loaded.
target remote-mobile /tmp/.XcodeGDBRemote-2682-69
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
run
Running…
[Switching to thread 11523]
[Switching to thread 11523]
sharedlibrary apply-load-rules all
continue
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/Library/PrivateFrameworks/DevToolsBundleInjection.framework/DevToolsBundleInjection (file not found).
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/info/dns.so (file not found).
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit (file not found).
objc[7245]: Class RootViewController is implemented in both /var/mobile/Applications/7DEA7218-9FC4-4428-8931-81F8F0B09323/iPhoneExample.app/iPhoneExample and /private/var/mobile/Applications/7DEA7218-9FC4-4428-8931-81F8F0B09323/iPhoneExample.app/iPhoneExampleTests.octest/iPhoneExampleTests. One of the two will be used. Which one is undefined.
objc[7245]: Class iPhoneExampleAppDelegate is implemented in both /var/mobile/Applications/7DEA7218-9FC4-4428-8931-81F8F0B09323/iPhoneExample.app/iPhoneExample and /private/var/mobile/Applications/7DEA7218-9FC4-4428-8931-81F8F0B09323/iPhoneExample.app/iPhoneExampleTests.octest/iPhoneExampleTests. One of the two will be used. Which one is undefined.
Test Suite 'All tests' started at 2011-02-02 13:58:45 +0000
Test Suite '/Developer/Library/Frameworks/SenTestingKit.framework(Tests)' started at 2011-02-02 13:58:45 +0000
Test Suite 'SenInterfaceTestCase' started at 2011-02-02 13:58:45 +0000
Test Suite 'SenInterfaceTestCase' finished at 2011-02-02 13:58:45 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.002) seconds

Test Suite '/Developer/Library/Frameworks/SenTestingKit.framework(Tests)' finished at 2011-02-02 13:58:45 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.007) seconds

Test Suite '/var/mobile/Applications/7DEA7218-9FC4-4428-8931-81F8F0B09323/iPhoneExample.app/iPhoneExampleTests.octest(Tests)' started at 2011-02-02 13:58:45 +0000
Test Suite 'RootViewControllerTests' started at 2011-02-02 13:58:45 +0000
Test Case '-[RootViewControllerTests testControllerReturnsCorrectNumberOfRows]' started.
Test Case '-[RootViewControllerTests testControllerReturnsCorrectNumberOfRows]' passed (0.001 seconds).
Test Case '-[RootViewControllerTests testControllerSetsUpCellCorrectly]' started.
Test Case '-[RootViewControllerTests testControllerSetsUpCellCorrectly]' passed (0.003 seconds).
Test Suite 'RootViewControllerTests' finished at 2011-02-02 13:58:45 +0000.
Executed 2 tests, with 0 failures (0 unexpected) in 0.004 (0.011) seconds

Test Suite '/var/mobile/Applications/7DEA7218-9FC4-4428-8931-81F8F0B09323/iPhoneExample.app/iPhoneExampleTests.octest(Tests)' finished at 2011-02-02 13:58:45 +0000.
Executed 2 tests, with 0 failures (0 unexpected) in 0.004 (0.016) seconds

Test Suite 'All tests' finished at 2011-02-02 13:58:45 +0000.
Executed 2 tests, with 0 failures (0 unexpected) in 0.004 (0.034) seconds


Debugger stopped.
Program exited with status value:0.
erik
 
Posts: 90
Joined: 10 Oct 2009, 15:22
Location: Hamburg, Germany

Re: Build problems with iPhoneExample

Postby mgladdish » 02 Feb 2011, 18:07

Thanks for the reply.

I recall that the first time I opened the project in XCode, it was configured for only the Optimized (armv7) architecture, and I had to change this setting to Standard (armv6 armv7).
I am running this on my iPhone 3G.

Here's the full output from my console:
Code: Select all
[Session started at 2011-02-02 15:54:26 +0000.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1510) (Fri Oct 22 04:12:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys002
Loading program into debugger…
warning: Couldn't get real path for inserted library /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/Library/PrivateFrameworks/DevToolsBundleInjection.framework/DevToolsBundleInjection

warning: Couldn't get real path for inserted library /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/Library/PrivateFrameworks/DevToolsBundleInjection.framework/DevToolsBundleInjection
Program loaded.

target remote-mobile /tmp/.XcodeGDBRemote-4134-29
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
run
Running…
[Switching to thread 11523]
[Switching to thread 11523]
sharedlibrary apply-load-rules all
continue
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/Library/PrivateFrameworks/DevToolsBundleInjection.framework/DevToolsBundleInjection (file not found).
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit (file not found).
objc[6429]: Class RootViewController is implemented in both /var/mobile/Applications/53A6B583-2F8F-4C91-9315-1B5719A7EB0B/iPhoneExample.app/iPhoneExample and /private/var/mobile/Applications/53A6B583-2F8F-4C91-9315-1B5719A7EB0B/iPhoneExample.app/iPhoneExampleTests.octest/iPhoneExampleTests. One of the two will be used. Which one is undefined.
objc[6429]: Class iPhoneExampleAppDelegate is implemented in both /var/mobile/Applications/53A6B583-2F8F-4C91-9315-1B5719A7EB0B/iPhoneExample.app/iPhoneExample and /private/var/mobile/Applications/53A6B583-2F8F-4C91-9315-1B5719A7EB0B/iPhoneExample.app/iPhoneExampleTests.octest/iPhoneExampleTests. One of the two will be used. Which one is undefined.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/info/dns.so (file not found).
Test Suite 'All tests' started at 2011-02-02 15:55:12 +0000
Test Suite '/var/mobile/Applications/53A6B583-2F8F-4C91-9315-1B5719A7EB0B/iPhoneExample.app/iPhoneExampleTests.octest(Tests)' started at 2011-02-02 15:55:12 +0000
Test Suite 'RootViewControllerTests' started at 2011-02-02 15:55:12 +0000
Test Case '-[RootViewControllerTests testControllerReturnsCorrectNumberOfRows]' started.
Test Case '-[RootViewControllerTests testControllerReturnsCorrectNumberOfRows]' passed (0.002 seconds).
Test Case '-[RootViewControllerTests testControllerSetsUpCellCorrectly]' started.
Program received signal:  “EXC_BAD_INSTRUCTION”.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
Xcode could not locate source file: OCMockObject.m (line: 71)


As far as I can tell, the major difference between our outputs is that your project appears to be running some SenTestingKit test suites, too. Here are your extra rows extracted from above:
Code: Select all
Test Suite '/Developer/Library/Frameworks/SenTestingKit.framework(Tests)' started at 2011-02-02 13:58:45 +0000
Test Suite 'SenInterfaceTestCase' started at 2011-02-02 13:58:45 +0000
Test Suite 'SenInterfaceTestCase' finished at 2011-02-02 13:58:45 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.002) seconds

Test Suite '/Developer/Library/Frameworks/SenTestingKit.framework(Tests)' finished at 2011-02-02 13:58:45 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.007) seconds
mgladdish
 
Posts: 2
Joined: 02 Feb 2011, 12:42
Location: London

Re: Build problems with iPhoneExample

Postby mattdipasquale » 22 Sep 2011, 16:12

This project works https://github.com/acani/OCMockSampleAppIOS
mattdipasquale
 
Posts: 3
Joined: 22 Sep 2011, 16:08


Return to OCMock