Strange situation give error: "The application bundle does not contain a valid identifier." - iphone

Today I experienced a very strange behavior with my XCode (using Version 4.2, iOS 5.0).
I read some another questions, but my problem is diferent and I never before had this issue.
So, XCode gives me the error "The application bundle does not contain a valid identifier." when I'm trying to run my app on a device (in the simulator just simply does nothing).
I'm sure that the project is correctly set, the bundle ID is correct, my certified is also correct..
I already try a lot of different approaches to solution the problem. Then I realized that it just gives the error when I add a folder to the project with the options "Create folder References for any folder added" selected (like the picture).
I have another apps with folders with folder references, and don't get any error..
Resuming: If I add the folder I get the error, If I don't add a folder, the app runs without any problem..
Could someone help me here trying to figure out whats happens (it's driving me mad).
Thanks!
EDIT:
I managed to mend the problem. I was adding a folder called "Resources", changing the folder name stops giving me the error.
But I would like to know/understand why was I getting the error..
Thanks

I managed to mend the problem. I was adding a folder called "Resources", changing the folder name stops giving me the error. But I would like to know/understand why was I getting the error..
Anyway, not a problem anymore..

I'm missing the target name after the icon at the Add to targets. Got lost somewhere?

Related

"The application does not have a valid signature" Xcode 4.3

I'm getting the weirdest error today.
"The application does not have a valid signature"
I get this error when I try to run the application from Xcode 4.3 on my device. Also when I archive it shows it as a generic archive instead of a real app.
Of course I deleted all of the invalid profiles, cleaned my derived data, cleaned my target, and restarted. No luck.
EDIT: Turns out that I had a folder reference in my app. I removed all of the references to the folders and made them groups and it worked!
Just throwing this out there, might help someone in the future (and also would be good for my future reference).
I have a bigger project with 2 projects within (an API and the main project that is running on the device itself and which uses the API).
I have solved this problem by cleaning both projects and then rebuilding them.
Ohhh...Cleaning the Project solved my problem..cheers :)
This saved me: http://www.two-tails.com/2010/01/12/the-application-does-not-have-a-valid-signature/
Basically you cannot have a folder reference called "resources"! I changed to "rsrc" and magic.
You can get a more detailed error message in the device log, which is extremely valuable for debugging this issue.
In XCode 7.3: Window -> Devices -> Select your device -> At the bottom there is an error log with detailed information.
For example in my case it outputs something like this:
Failed to install application at file:///var/mobile/Media/PublicStaging ... : Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=ApplicationVerificationFailed, ErrorDetail=-402620391,
ErrorDescription=Failed to verify code signature of
/private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.iKT2NH/extracted/XYZ.app
/Frameworks/Raygun4iOS.framework : 0xe8008019 (The application does not have a valid signature.)}
So in my case it is somehow caused by the Raygun framework that I have installed.
Turns out that I had a folder reference in my app. I removed all of the references to the folders and made them groups and it worked!
Also, make sure that when you go to Product > Scheme > Edit Scheme the Build Configuration is set to Running.
I struggled with this for a few hours, but it seems that if you have a framework listed under "Embedded Binaries" as well as being imported through a swift bridging header, this error comes up. I am running XCode 8 with iOS 10. I would try removing your framework from the embedded binaries tab under general settings of your XCode projects. Hope this helps out some person in the future!

Issue installing zxing on xCode 4.2

I recently tried installing zxing in xCode 4.2 for my next app. Here is what happened.
I began following the steps, everything was going ok, the first strange thing I noticed is that libZXingWidget.a library showed up red when I added it. I started to get worried because xCode still baffles me. The rest of the steps were followed without issue until I added paths to the header search paths. I tried using an absolute path from /Users to the /cpp/core/src/ and /iphone/ZXingWidget/Classes directories I set up then a relative path and no matter what I get the following error:
clang: error: no such file or directory: '/Users/myusername/Desktop/../../cpp/core/src/zxing/common/GreyscaleLuminanceSource.cpp'
Which .cpp file is causing this seems to rotate around. Funny thing is that do not ever even specify Desktop in my header search paths. Early on I had my folders on my desktop and I was referencing them from there but since then I have deleted that project and have a completely new one. I have no idea what is causing the project to search that location and I would like to know how I can change it.
Thanks!
Try deleting then re-adding the lib. If the problem still occurs, you may want to look into the pbxproj xml file with a text editor to try to see where the wrong path come from.
I had similar problem. Try to move your "cpp" folder to "Users", if it helps then you have problems with your pathes.

iPhone project "No launchable executable present at path"

I downloaded one of the sample apps for iOS and it gives me the above error.
No launchable executable present at path /Users/..../MyProject/build/Debug-iphonesimulator/MyProject.app
What i do have is the MyProject/build/MyProject.build/Debug-iphonesimulator/GeneratedResources.build/ some files.
No build errors.
When I see in the finder the directory is indeed not even present. What could be the problem ?
Update: Yes, i did try cleaning & deleting Build directory, doesn't help
I also had this same error code for my project. I was using a number in the Target -> Product Name. Once I changed the Product Name of the target to letters only everything worked fine.
Try opening the Info.plist and removing "executable name" value if it's filled with custom string instead of string variable (the one that should look like ${FOO_BAR}, but doesn't).
I had this problem. it turned out I had the active target set incorrectly, in my case to a cocos library instead of to my own app.
After trying the things mentioned here, also make sure you click on "Clean All Targets" then quit XCode and restart XCode. This fixed it for me and many others on the web!
I had the same problem. In my case, I had an additional target for the same project (which contained test libraries). At some point xCode always tried to launch the test binary, regardless of what binary it compiled.
Removing the pbxuser and perspective files (inside project.xcodeproj) solved it for me.

Xcode falsely claims CFBundleExecutable to be (null)

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

iPhone: Failed to launch simulated application: Unknown error

This is a new iPhone project, only 1 target (different from this question)
On build we get:
Failed to launch simulated application: Unknown error.
The google again gives us nothing, lots of people have encountered this and there are lots of crazy ideas to try "oh clean the build", "clear the cache", "twiddle this flag" and none of them work and work consistently. We can reproduce this on two different machines with SDK 2.2.1 and 3.0 beta. Not the install on the machines since other iphone projects work just fine so we believe it has something to do with the config of this particular project but after combing through the config twice we can't spot the problem.
Vanna, I'd like to buy a clue for $200 please.
Tried: XCode menu->Clear cache
Tried: clean all targets
Tried: rm -rf ~/Library/Application\ Support/iPhone\ Simulator
This happened to me once and I think I saw in a blog to simply quit and restart Xcode. Miraculously, it worked for me. I doubt this is the end all solutions to all problems like these though, but if you haven't yet closed Xcode, it's worth a try.
I sometimes see this problem and it is fixed by rebooting the maching. I suspect the internal state of the simulator gets screwed. Doesn't sound like your problem though.
I agree with MiRAGe; if this persists, start a new project and import your source.
If other projects work fine; start a new one and copy the files. Combing through configs just won't do it (since XCode has, well, thousands of config possibilities).
You can send me a check with the $200.
P.S: When you actually do start a new project, do it step by step. Run it after each change. Maybe you will find your problem. It might be a ton of work, but it might also help the other thousands of lost souls who have an 'Unkown Error'.
Changing the product name worked for me. I tried several different alternatives and all of them worked fine. It was the "magic product name" I used at the onset that failed every time I went back to it. YMMV.
This might be because items are missing for the target. Expand the target and verify that all needed source files and libraries are there. Restart Xcode after you've messed around.
alt text http://pici.se/pictures/TsnTQxhKh.png
Thanks ...Did have the same problem or worse. My app wasn't loading in the simulator, alternatively sometimes the build failed. Now realized it's pretty logical.
When you create a new project and info.plist get associated with the project.
Each time you add a modify/add the target another plist is generated with the new name.
But the original association with the info.plist is still around and there's a conflict.
So remove that association from the current target or better still remove from project and trash the info.plist.
Just make sure in the target settings(do getInfo) the correct info.plist is mentioned.
Note the name for product/target should not have spaces. If you really want it change the bundle display name.
Now the only reason why xcode should be closed is to ensure the project file has registered all changes.
I got this problem when I added the .plist to my target (Info.plist -> Get Info -> Targets -> Target Memberships). It went away when I unchecked it again.
I see that that's separate from the Targets -> -> Get Info -> Build -> Packaging -> "Info.plist file" -> my.plist that trips mentioned, but I still don't really understand what's going on, and definitely don't understand why we get such an unhelpful error message.
I've had this twice for the same reason: adding a folder called Resources to the project. This is a naming conflict with something (though there is nothing called "Resources" in the application bundle by default). It might be that mysterious naming conflicts are a common cause of this problem.
To fix I renamed the folder to something else ("Assets"), manually deleted the entire build folder (clean didn't work) and quit the simulator.
Another thing to try if you are desperate is to change the 'Product Name' setting. This worked for me once when everything else didn't.
I had the same problem because I had changed the BundleName and some other values but not changed the PRODUCT_NAME. I had problems finding where PRODUCT_NAME is defined: Get Info on the target, Build-tab and it is down the list somewhere.
I changed PRODUCT_NAME to match the bundle name, restarted Xcode and it worked.
Fred
I had this problem recently and the fix was ridiculously simple. I remembered that I had been editing the target settings and under the "Properties" tab in the "Executable" field there was a space after the value which was ${EXECUTABLE_NAME}. Yes, a single space. It was impossible to see unless you highlight the field. I figured this out because I had edited that field seeing if I could add a command line option that way. I guess when I cut the additional option back out, I missed a space. So while this is the only possible cause of this problem, it's worth checking out.
Had same problem. None of the answers above worked for me. Then i remember i had just added the icon to the Resources folder before the problem started. Moved icon to Other Sources folder and it worked. Weird!
Thanks Guys.
I had the Product name different than in the info plist. A restart once I fixed that made it all go away.
ps, stackoverflow has been a real help to beginners like me. Thanks from downunder.
I add this issue with a folder named "resources". Rename it, clean every thing and run again.
1) Restart Xcode;
2) Use "Get Info" on Info.plist and uncheck current target (Info.plist would be added anyway).
That's all.
I can confirm that a naming conflict was the source of our problem. We had a filesystem folder named resources inside the Xcode group named Resources. Sometimes we would get the error and a system would lock up and sometimes it would not. Changing the folder to the name assets resolved our problem. After reading some of the above comments - it appears that Xcode group names can clash with directory/folder names.
This happened to me when I changed my version number from 1.0 to 0.1. When I changed it back it started working again.