Xcode falsely claims CFBundleExecutable to be (nul

2020-02-29 06:52发布

问题:

I'm trying to create an ad-hoc build of an iPhone app for beta testing.

On their end, they're seeing an error like the following:

"The info.plist for application at xxx specifies a CFBundleExecutable of (null), which does not exist"

Here is an excerpt from the actual info.plist:

<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>

And it clearly is not null.

What am I doing wrong here?

回答1:

The WORKING SOLUTION is this (and only this):

In Xcode, choose “Executables” from the project hierarchy. Click your project executable then press Command-I. Choose the General tab and set the working directory to “Build Products directory”.

Found via BrainwashInc, who credits MacHackShack. I thought this valuable information was way too important to leave floating around on random blog.

It seems like sometimes XCode may flip this setting, as I suddenly started having this issue, and the fix above repaired it. Changing it back to "project directory" reproduces the issue for me, every time.

I also had to restart XCode to get the debugger to work once this fix installed the app, that may be unrelated.



回答2:

I don't think there is ONE working solution to this. I found several solutions that doesn't work for me. At the end, I did find one solution.

By deleting whatever I had in the "Producs" folder in xCode I managed to get it working. I am using xCode 3.2.1.

Note: I did the change regarding "Build Products directory” above as well, perhaps both solutions needs to be implemented, up to you to try it out.

This is, to say the least, quite anoying. As a beginner, things are complicated enough without bugs in the SDK...

Hope this will help someone out there!

Cheers



回答3:

It sounds like you're looking at the info.plist in the project not the built product.

The '${EXECUTABLE_NAME}' in the project info.plist is just a place holder for a variable in the build script. You need to look at the info.plist in your built product to see what is listed there. It sounds like for some reason, the build script is not populating the field as it should.

You might actually check that the contents of the application package actually has an executable. Sounds weird I know but a few years ago I mucked about with my build setting son a project and ended up with a product without an executable. Everything else, the package, resources, string files etc was there just no actual program.



回答4:

This is a know issue of SDK:

Changing an iPhone Executable's working directory from “Build Products directory” may cause the application not to install properly with the error message “The Info.plist for application at (null) specifies a CFBundleExecutable of (null), which does not exist.”

as you can see here: http://developer.apple.com/iphone/library/releasenotes/General/RN-iPhoneSDK-3/index.html

For me, it worked to change the working directory. I created the problem deleting by hand the build directory.