Every ti开发者_开发百科me I create an Xcode 4 project (iPhone app, cocoa library...) the .app file or the .a file under Products group appears in red (is missing).
Even if I build the project the file stills in red.
All my settings are default.
Try Building and Running on a device, I've noticed the same red text problem, but selected my iPhone and the red text has disappeared.
I have solved the problem with the following process:
Select projectname -> Click project -> Build Setting -> Search "Per-configuration Build Products Path"
Remove the extra string from there.
- Finally confirm you have to add
$(BUILD_DIR)/$(CONFIGURATION)
I too had an issue with red .app files in the Products folder. I tried many of the remedies offered, but none worked. My particular issue may have been different. If you have the same symptoms, my solution might work for you too.
Symptoms
- Red .app files in the Products folder in the Navigator area (left section of xcode)
When selecting the .app, the Utility area (right section of xcode) the File inspector view the “Full Path” displays:
/Users/[user name]/Library/Developer/Xcode/DerivedData//Build/Products/Debug/[app name].app
The app file is located at (note the -iphoneos after Debug):
/Users/[user name]/Library/Developer/Xcode/DerivedData//Build/Products/Debug-iphoneos/[app name].app
Select the following:
a. the project in the Navigator area (left section of xcode) (Symptom 4 - A)
b. the project in the Editor area (middle section of xcode) (Symptom 4 - B)
c. “Build Settings” tab (Symptom 4 - C)
Search for “Per-configuration Build Products Path” (Symptom 4 - D). The value is build/Debug
instead of build/Debug-iphoneos
.
Solution
Select the following:
a. the project in the Navigator area (left section of xcode) (Solution 1 - A)
b. the project in the Editor area (middle section of xcode) (Solution 1 - B)
c. “Build Settings” tab (Solution 1 - C)
Set the value of “Base SDK” to
Latest iOS (iOS 6.0)
. Actually any of the iOS options should work. (Solution 1 - D)Set the value of “Architectures” to
Standard (armv7, armv7s)
. (Solution 1 - E)Set the value of “Supported Platforms” to
iOS
(Solution 1 - F)
Notice
The value for Per-configuration Build Products Path – Debug is build/Debug-iphoneos (Solution 1 - G)
The .app files are no longer red. (Solution 1 – H)
The “Full Path” for the .app is:
/Users/[user name]/Library/Developer/Xcode/DerivedData//Build/Products/Debug-iphoneos/[app name].app
It is a bug but a superficial one - it happens when you clean your project. If the file is under the Products folder, those items are only for the purpose of displaying the output of the build process. If you build and run again it should not be red anymore but if it is red, it isn't affecting your app.
Click on Product -> Clean Build Folder and then try again to build app for current selected device. Maybe not from first, but from second time it will build correctly.
精彩评论