Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

xcode - "This app contains an app extension with an illegal bundle identifier" issue

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.

Whenever I try to run today widget, it builds successfully, but instead of being launched, it says

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

However, I checked Info.plist and my bundle identifier is

com.myname.myappname

and my bundle identifier of my today widget is

com.myname.myappname.mywidget

Isn't this just right?? I cleaned and built again and again..but it just won't work.

And NO GOOGLE RESULT! Am I the only person with this problem??

My bundle name is not 'myappname', if it is the problem.

Any help is appreciated.

Something's gone bad and I don't know where to look!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If the selected answer doesn't work, I found what appears to be an issue in xcode switching between some target schemas which caused this.

In this case, try doing a complete clean, as well as a clean of the build folder (hold down ALT when selecting product/clean).

Addendum: As this happens fairly often for me now, a quicker fix is to also remove all .appex files. Eg:

cd ~/Library/Developer/Xcode/DerivedData
find . -name "*.appex" -exec rm -fr {} ;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...