简体   繁体   中英

ERROR: The application bundle does not contain a valid identifier

I'm getting this error "The application bundle does not contain a valid identifier" after my application successfully compiles.This error prevents my game from launching on the phone or the simulator. I have no idea how to fix this as I was following this tutorial How To Make A Space Shooter iPhone Game using Cocos2d.

in my case (working with fastpdfkit, following the 3-minute-tut), the Info.plist was not copied to the bundle. i had to manually (re-)add it in the "Buildphase > Copy Bundle Resources"

The problem that was causing this error message for me was that I had a folder called "Resources":

This error can also be caused if your project has a sub_directory called 'Resources'; and possibly other special names that I didn't trip over. - source

I also had the -Info.plist file missing from the Buildphase (thanks to thumbsup for his answer above ).

删除DerivedData路径~/Library/Developer/Xcode/DerivedData

This could be because the bundle identifier has invalid characters in it or no characters in it. The bundle identifier is found in the Info.plist file.

This is what constitues a valid application bundle identifier:

The bundle identifier string identifies your application to the system. This string must be a uniform type identifier (UTI) that contains only alphanumeric (AZ,az,0-9), hyphen (-), and period (.) characters. The string should also be in reverse-DNS format. For example, if your company's domain is Ajax.com and you create an application named Hello, you could assign the string com.Ajax.Hello as your application's bundle identifier. The bundle identifier is used in validating the application signature. source (apple developer)

This may also be of use:

An identifier used by iOS and Mac OS X to recognize any future updates to your app. Your Bundle ID must be registered with Apple and unique to your app. Bundle IDs are app-type specific (either iOS or Mac OS X). The same Bundle ID cannot be used for both iOS and Mac OS X apps. source

This is somewhat of a double post - I posted the same answer at gamedev.stackexchange.com .

For some reason, Xcode removed the Info.plist file from the app target..

  1. Select the Info.plist in the Project Navigator

项目导航器

  1. Tick the box for your application

目标会员

  1. Clean + Build + Run

Had the same issue. This is how it solved itself:

  1. Remove all your extensions from Build Phases > Target Dependencies and Build Phases > Embed App Extensions stages.
  2. Run Product > Clean .
  3. Try compiling. For me it worked flawlessly.
  4. Add your extensions one by one and do Product > Clean + Product > Run after adding each of them.

Hope this helps.

在我的例子中,一个简单的干净选项-com-K和shift-option-command-K就可以了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM