PDA

View Full Version : Can't test my app on device in Xcode 4 and other problems




tutiplain
May 3, 2011, 09:50 PM
Hi everyone,

I've been having problems while trying to test out my app on my device (iPod Touch). Perhaps it might be something in my Mac that might be misconfigured, or maybe XCode 4 has some bugs, or maybe I'm just doing something wrong.

As background: I have XCode 3 installed in /Developer_old.

Here's how it goes: I deleted an expired "Team Provisioning Profile" from my device using XCode 4's Organizer. I then used the Provisioning assistant available on the Apple Developer site to generate a new provisiosing profile. I installed it by double clicking on it. This opened XCode 3's Organizer and installed the profile. I closed it, and opened it with XCode 4's organizer. I then downloaded the developer certificate from the Provisioning Assistant and installed it by double clicking on it. This opened Keychain Access where I can see it is installed.

Now, I can see that my device has the profile installed, but when I attempt to run it, I get a "No provisioned devices found" error. I tried to run it on Xcode 3, but I got a bunch of errors, and now, not even Xcode 4 will run it, not even in Simulator mode. I did not save the exact messages, but from what I understood, it was having problems locating .dylib files on my system (including libobjc.dylib, which sounds like its part of the Objective-C runtime).

I realize there is not much you can help me with unless I post the exact errors I was getting, but I think some background knowledge might help me understand this process better, so here are my questions:

- Is there a way to "cleanly" remove an existing Xcode installation?
- Is there any problem with having two versions of XCode on the same machine like I do? Like any incompatibility issues?
- Does manually deleting the /Developer folder cause any harmful damage, like perhaps, broken links, when I reinstall it?
- What is the difference between a Provisioning Profile and a Developer Certificate?
- It seems that provisioning profiles only work on the Xcode version they were originally installed on. Is this true? Why does double clicking on my .mobileprovision file open it with XCode 3, even though it now resides in /Developer_old?

Thanks for any input. It is greatly apreciated.

EDIT:

Hi again,

I deleted both /Developer and /Developer_old folders and did a clean install of XCode 4.0. The app no longer gives warnings and runs with no problems in Simulator. However, I still can't test it on my device, even after removing and reinstalling my Provisioning Profile. What can I do? Please, help!



dantastic
May 4, 2011, 02:20 AM
Make sure that there is a deployment target set.
Select the summary page of your target. The deployment target drop down. make sure it has a value (and not just in grey).

xCode4 seems to be forgetting that one at times.

tutiplain
May 4, 2011, 01:33 PM
Hi

Thanks for your reply Dan. "4.2" was set as the deployment target (which is also my iPod OS version). When I compiled, I got the following:


d /Users/ocampos/Library/Developer/Xcode/DerivedData/SueldoCalc-erlcpmxwibxgvoewahrcnyaigkot/Build/Products/Debug-iphonesimulator/SueldoCalc.app/SueldoCalc normal i386
cd /Users/ocampos/Documents/SueldoCalc
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/ocampos/Library/Developer/Xcode/DerivedData/SueldoCalc-erlcpmxwibxgvoewahrcnyaigkot/Build/Products/Debug-iphonesimulator "-L/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib" -F/Users/ocampos/Library/Developer/Xcode/DerivedData/SueldoCalc-erlcpmxwibxgvoewahrcnyaigkot/Build/Products/Debug-iphonesimulator -filelist /Users/ocampos/Library/Developer/Xcode/DerivedData/SueldoCalc-erlcpmxwibxgvoewahrcnyaigkot/Build/Intermediates/SueldoCalc.build/Debug-iphonesimulator/SueldoCalc.build/Objects-normal/i386/SueldoCalc.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lsqlite3.0 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/ocampos/Library/Developer/Xcode/DerivedData/SueldoCalc-erlcpmxwibxgvoewahrcnyaigkot/Build/Products/Debug-iphonesimulator/SueldoCalc.app/SueldoCalc

ld: warning: ignoring file /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libsqlite3.0.dylib, missing required architecture i386 in file
ld: warning: ignoring file /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libSystem.dylib, missing required architecture i386 in file
ld: in /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libobjc.A.dylib, missing required architecture i386 in file for architecture i386
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1


After attempting this build, now every other deployment target fails to build, too, even when running in Simulator. Here is the log for when I try to run it using iOS Simulator 4.2:


Ld /Users/ocampos/Library/Developer/Xcode/DerivedData/SueldoCalc-erlcpmxwibxgvoewahrcnyaigkot/Build/Products/Debug-iphonesimulator/SueldoCalc.app/SueldoCalc normal i386
cd /Users/ocampos/Documents/SueldoCalc
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/ocampos/Library/Developer/Xcode/DerivedData/SueldoCalc-erlcpmxwibxgvoewahrcnyaigkot/Build/Products/Debug-iphonesimulator "-L/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib" -F/Users/ocampos/Library/Developer/Xcode/DerivedData/SueldoCalc-erlcpmxwibxgvoewahrcnyaigkot/Build/Products/Debug-iphonesimulator -filelist /Users/ocampos/Library/Developer/Xcode/DerivedData/SueldoCalc-erlcpmxwibxgvoewahrcnyaigkot/Build/Intermediates/SueldoCalc.build/Debug-iphonesimulator/SueldoCalc.build/Objects-normal/i386/SueldoCalc.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lsqlite3.0 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/ocampos/Library/Developer/Xcode/DerivedData/SueldoCalc-erlcpmxwibxgvoewahrcnyaigkot/Build/Products/Debug-iphonesimulator/SueldoCalc.app/SueldoCalc

ld: warning: ignoring file /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libsqlite3.0.dylib, missing required architecture i386 in file
ld: warning: ignoring file /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libSystem.dylib, missing required architecture i386 in file
ld: in /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libobjc.A.dylib, missing required architecture i386 in file for architecture i386
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1


It seems to me that device testing is simply broken in XCode 4. I'll have to do another clean install (the second one this week) in order to make these errors go away and be able to at least continue development. If you have any more advice, it is welcome.

EDIT:

Did a clean install of XCode 3, and it had the same problems. It seems that the problem might be in the libsqlite.dylib I am including with the project. Since the error says "missing required architecture" I'm guessing I need a libsqlite.dylib file specifically compiled for iOS, or something like that?