.app file appears in red (missing) in new projects

2019-01-03 15:25发布

Every time 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.

Thanks in advance.

标签: xcode4
4条回答
疯言疯语
2楼-- · 2019-01-03 16:07

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.

查看更多
该账号已被封号
3楼-- · 2019-01-03 16:13

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

  1. Red .app files in the Products folder in the Navigator area (left section of xcode) Symptom 1
  2. 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 Symptom 2

  3. 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

  4. 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.Symptom 4

Solution

  1. 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)

  2. Set the value of “Base SDK” to Latest iOS (iOS 6.0). Actually any of the iOS options should work. (Solution 1 - D)

  3. Set the value of “Architectures” to Standard (armv7, armv7s). (Solution 1 - E)

  4. Set the value of “Supported Platforms” to iOS (Solution 1 - F) Solution 1

Notice

  1. The value for Per-configuration Build Products Path – Debug is build/Debug-iphoneos (Solution 1 - G)

  2. The .app files are no longer red. (Solution 1 – H)

  3. The “Full Path” for the .app is:

    /Users/[user name]/Library/Developer/Xcode/DerivedData//Build/Products/Debug-iphoneos/[app name].app

查看更多
Luminary・发光体
4楼-- · 2019-01-03 16:19

I have solved the problem with the following process:

  1. Select projectname -> Click project -> Build Setting -> Search "Per-configuration Build Products Path"

  2. Remove the extra string from there.

  3. Finally confirm you have to add $(BUILD_DIR)/$(CONFIGURATION)

enter image description here

查看更多
乱世女痞
5楼-- · 2019-01-03 16:21

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.

查看更多
登录 后发表回答