“This app contains an app extension with an illegal bundle identifier” issue

后端 未结 3 1304
南笙
南笙 2020-12-16 15:43

I\'m a bit mixed up, since I changed the app name, Bundle Display name, and Bundle identifier name...and now my app works properly, but my today widget won\'t.

Whene

3条回答
  •  遥遥无期
    2020-12-16 16:27

    I ran into a similar problem with the Bundle identifier in a share extension

    error

    app Info.plist: com.company.product.$(PRODUCT_NAME:rfc1034identifier)
    ext Info.plist: com.company.product.$(PRODUCT_NAME:rfc1034identifier)
    

    So I ended up with

    app Info.plist: com.company.product.product
    ext Info.plist: com.company.product.product_ext
    

    which passed the build checks but refused to run on a device with error:

    This app contains an app extension with an illegal bundle identifier. App extension bundle identifiers must have a prefix consisting of their containing application's bundle identifier followed by a '.'.

    Once I removed the extra product, the build ran on a device.

    correct

    app Info.plist: com.company.$(PRODUCT_NAME:rfc1034identifier)
    ext Info.plist: com.company.product.$(PRODUCT_NAME:rfc1034identifier)
    
    app Info.plist: com.company.product
    ext Info.plist: com.company.product.product_ext
    

    I discovered my error when I accidentally changed the application Info.plist instead of the extension Info.plist. To aid in debugging the problem, introduce an error into the application Info.plist, and you should get a build error with the Bundle identifier of the app and extension:

     ERROR.com.myname.myappname
    

提交回复
热议问题