Safari App Extension: Cannot find executable file that matches the value of CFBundleExecutable in nested bundle - xcode9

I'm trying to validate my OS X application's archive, but I keep running into the following errors.
Bad CFBundleExecutable. Cannot find executable file that matches the value of CFBundleExecutable in the nested bundle MySafariExtension [My-Company.MyMacApp.pkg/Payload/MyMacApp.app/Contents/PlugIns/MySafariExtension.appex] property list file.
An unknown error occurred.
Bad CFBundleExecutable. Cannot find executable file that matches the value of CFBundleExecutable in the nested bundle MySafariExtension [My-Company.MyMacApp.pkg/Payload/MyMacApp.app/Contents/PlugIns/MySafariExtension.appex/Contents] property list file.
An unknown error occurred.
When I explore the contents of my app I can see the the nested executable in MyMacApp.app/Contents/Plugins/MySafariExtension.appex/Contents/MacOS/MySafariExtension
But when I install the app from a .pkg file the extension does not show in Safari. I still see the executable in the same path. I looked at this question without any luck figuring out what's going on.
Resources are scarce for Safari App Extension so hopefully some clarification as to what's going on here will help a lot of people! Thanks in advance.
UPDATE
After installing the package, if I click Allow Unsigned Extensions in Safari I can see the extension in safari preferences. So maybe there is an issue when signing the Safari App Extension. I'm using the same team/cert that is signing the OS X app though.

Turns out the issue was with the SafariAppExtension Info.plist. I mistakenly had it targeted as a member of the SafariExtension bundle and that was causing the issue.

Related

App installation request in osx

I have a nwjs app that was built using nwjs-builder to create mac application (MyApp.app) and then packed into dmg image with node-appdmg.
If i don't have any version of my app in Applications folder yet, I get this dialog when I double click on the app in mounted dmg image:
And when I click 'install' i get this:
Now my question is - can I control this behaviour somehow? Disable that installation offer, or find out how does it try to install and why does it fail? Could not find any clues inside generated build or in nwjs-builder or in node-appdmg.
Here is what I found. The dialogs and installation code is not a part of nwjs, but chromium (chromium.src/chrome/browser/mac/install_from_dmg.mm).
I found 2 ways to disable installation request.
Make dmg writable - add format: "UDRW" to appdmg settings.
nwjs accepts chromium arguments by 'chrome-args' key in manifest. Specify --no-first-run to disable installation request. But this is a risky way, no first run key might affect many internal processes.

Xcode - failing to validate archive due to weird issues with resolving variables/placeholders in info.plist and entitlements

Something is really broken with my project or Xcode and I'm struggling since two days to figure out what is going on.
My application is running perfectly fine, it is an OS X application and it contains a Today Widget extension. I finalized the project recently and now I'm unable to publish the app due to validation errors.
It started with the validator complaining about my Application Group, which I use to share content between the main application and the Widget extension. The group was defined as $(TeamIdentifierPrefix)com.acme.GreatApp.
The validator was complaining that my Group name was in the wrong format and should rather start with my TEAMID. After 3 hours of running in circles I replaced the placeholder $(TeamIdentifierPrefix) with my team ID (e.g. S3F45A5S35.) – and that worked.
Then the validator complained about every kind of other placeholder in my info.plist and entitlements files, things like $(PRODUCT_NAME), com.acme.GreatApp.$(PRODUCT_NAME:rfc1034identifier) and $(EXECUTABLE_NAME). I replaced all those placeholders with their corresponding values, which then was accepted.
Then, for a while the validator complained about structural issues, which do not make too much sense to me:
iTunes Store operation failed.
Bad CFBundleExecutable. Cannot find executable file that matches the value of CFBundleExecutable in the nested bundle GreatAppWidget [com.acme.GreatApp.pkg/Payload/GreatApp.app/Contents] property list file
iTunes Store operation failed.
Bad bundle identifier. The bundle identifier 'com.acme.GreatApp.GreatAppWidget' of the application extension GreatApp.app/Contents/Plugins/GreatAppWidget.appex should extend the dotted path of the bundle identifier of its containing application (com.acme.GreatApp.GreatAppWidget)
Are you telling me my extension is contained in my extension?
iTunes Store operation failed.
Invalid bundle location. Bundle GreatApp.app/Contents/Plugins/GreatAppWidget.appex must be contained in parent bundle's Contents/Plugins directory.
Well, the error states that I should do what it claims is not correct. Obviously it IS in the parent apps folder Contents/Plugins. So what?
iTunes Store operation failed.
The CFBundleExecutable of two bundles may not point to the same file. The following shared bundle path have been found: GreatApp.app/Contents.
The thing is, my app and extension work perfectly fine. If there was anything broken like dependencies, paths or whatever, something most likely wouldn't work, no?
Furthermore, I did not modify any of the build settings or just anything which I do not understand. These are all the default settings. I created a new Cocoa application, added a new Today Widget Extension as target - and that is it. I did not mess around with any paths, locations, dependencies, anything.
Anyway, those errors were only visible for a while and I'm lucky I made a screenshot then. Because now, again it is showing raw placeholders in the error messages, even though I didn't change a thing that could cause that. The only thing I can recall I did was to delete/revoke all provisioning profiles and certificates locally on disk, in the Keychain, and in the Member Center and created everything from scratch through Xcode.
Now the errors look like this:
iTunes Store operation failed.
Bad CFBundleExecutable. Cannot find executable file that matches the value of CFBundleExecutable in the nested bundle ${bundleName} [${bundlePath}] property list file
iTunes Store operation failed.
Bad bundle identifier. The bundle identifier '${bundleIdentifier}' of the application extension ${bundlePath} should extend the dotted path of the bundle identifier of its containing application (${parentBundleIdentifier})
iTunes Store operation failed.
Invalid bundle location. Bundle ${bundlePath} must be contained in parent bundle's ${pluginsSubPath} directory.
iTunes Store operation failed.
The CFBundleExecutable of two bundles may not point to the same file. The following shared bundle path have been found: ${sharedBundlePath}.
So I thought maybe Apple just fuped it in the recent update and you just can't validate an app with extension. So I searched the web and found the really nice example Today-Scripts. I added app groups ($(TeamIdentifierPrefix)com.acme.Today-Scripts, the placeholder here perfectly works) to all targets, activated sandboxing, changed certs and provisioning profiles: And it perfectly validates!
So I compared all the build setting etc. And except that I had to replace the placeholders with their actual values, obviously the certs and profiles and the fact that in Today-Scripts there is an additional XPC target which is embedded into the Widget, they are atomically the same. Every single setting is the same.
I cleared all caches, really hard. Cleaned the project, cleared ~/Library/Developer/Xcode/DerivedData as well as ~/Library/Caches/com.apple.dt.Xcode, restarted several times, nothing helps.
I'm really desperate as I have no idea left what I can do. Please someone shed some light on what the heck Xcode is doing here and why.
What causes Xcode to fail to interpret all the placeholders in the info.plist and entitlements files?
How can these bundle errors above happen when I am working with
the exact settings XCode created by creating new cocoa app and adding an extension target?
the exact same settings/dependencies as the Today-Scripts example?
I finally found the culprit! The problem was, for some reason I can not explain, the info.plist of the extension was a member (Target Membership) of the main application. I just found that by analyzing the created archive file by file and found an additional info.plist inside the GreatApp.app/Contents/Resources folder. In that file the placeholders were not resolved. The archive validator then used this info.plist for validation.
That little checkbox cost me 3 days.
I was getting
"iTunes Store operation failed. Bad CFBundleExecutable. Cannot find executable file that matches the value of CFBundleExecutable in the nested bundle ${bundleName} [${bundlePath}] property list file"
error when I try to submit my adobe air app to mac app store.
The executable is located at "/Contents/Frameworks/Adobe AIR.framework/Versions/1.0/Resources/AdobeCP15.plugin/Contents/MacOS/AdobeCP"
In info.plist file located at "/Contents/Frameworks/Adobe AIR.framework/Versions/1.0/Resources/AdobeCP15.plugin/Contents/info.plist"
it is written as
CFBundleExecutable
adobecp
These files are generated automatically but it took time to discover the case-sensitivity. Therefore, I changed it into
CFBundleExecutable
AdobeCP
and error message disappeared.
I ended up at this post because I had a similar error, but a different cause. My issue was caused by having a WatchKit app and having the 'Embed Watch Content' Build Phase after my 'Run Script' Phase. Once I moved the 'Embed Watch Content' Build Phase in between 'Copy Bundle Resources' and 'Embed Frameworks', the validation of the WatchKit succeeded.

Unable to find APP_BUNDLE_PATH. Cannot find a built app that is linked with calabash.framework

I am running calabash-cucumber in xcode 5.0.1 on OSX 10.9.1, but getting this error while executing the test script. I have installed calabash framework successfully, but don't know why this error occurs.
Error... Unable to find APP_BUNDLE_PATH.
Cannot find a built app that is linked with calabash.framework
Please build your app from Xcode
You should build your calabash target.
Alternatively, specify APP_BUNDLE_PATH in features/support/01_launch.rb
This should point to the location of your built app linked with calabash.
(RuntimeError)
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.9.168/lib/calabash-cucumber/launch/simulator_helper.rb:178:in `app_bundle_or_raise'
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.9.168/lib/calabash-cucumber/launcher.rb:307:in `relaunch'
/Users/mymac/Desktop/myproject/myproj/features/support/01_launch.rb:29:in `Before'
Does your simulator or device contain the YourApp-cal target installed? Check weather you run the YourApp-cal target once from the xcode to install the app with calabash server on simulator or device.
Then Check you have followed setup Process
You need to have xcode tools installed too.
Check these things too.
Build the yourApp-cal target and run using xcode once.
While App is running open a Terminal(console) and type calabash-ios console. If your ruby environment is correct it will open you a ruby console.
In that console type
server_version['version']
and
Calabash::Cucumber::FRAMEWORK_VERSION
you should get something like "0.9.164"
calabash.framework is installed correctly in your app.
If so You should go to the file /YourProject/features/support/01_launch.rb open it check weather app bundle path is specified or not (if it is commented out calabash automatically detect the default app bundle path) if you are building your app to somewhere else than the default place you need to specify the appbundle path here in this file.
Tell us more details after check this list so we can help you more..
I hit the same issue, the way I got around to it is, on Xcode's top-right corner there is "Identity and Type" window. There you will find the full path of anything that you select on left (Project Explorer window).
Now usually on the ProjectExplorer window you should have "Classes", "Common", "Frameworks", "Other Sources", "Product", "Resources", "Scripts" etc. (It might be slightly different project by project). Inside "Product" is where your .app lives.
Select your app and you'll see the whole path on "Identity and Type" window.
Copy and paste it to "support/launch.rb" where it says APP_BUNDLE_PATH.
Should work now.
Edit 29/07/14: Do you see
HTTPServer: Started HTTP server on port 37265 on 'All output' window of Xcode (my version of Xcode is 5.1) when you build ?
There is a better way to set up calabash so you won't have this problem.
It involves creating a configuration, rather than a -calabash target. Basically you
1. create a configuration
2. add calabash framework to that configuration in build settings
3. add framework search path to find that framework
4. create a scheme to run calabash
The longer version can be found
http://fangmobile.com/2014/05/08/do-you-love-calabash-ios-but-hate-that-cal-second-target/
Deleting the contents of /Library/Developer/Xcode/DerivedData and compiling again solved this problem for me.
My error message was Unable to auto detect APP_BUNDLE_PATH.

Xcode 4.4.1 code signing issue

I have this code signing issue that came up only recently when I tried to submit my Mac application (not iOS) with Xcode 4.4.1
When I tried to validate my app's archive, validation fails with these two errors:
Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: 'com.(mycompany).(myapp)' for the key 'com.apple.application-identifier' in 'MyAppBundle.app/Contents/MacOS/MyAppExecutable'
Invalid code signing entitlements. Your application's bundle signature contains code signing entitlements that are not supported on Mac OS X. Specifically, value 'com.(mycompany).(myapp)' for key 'com.apple.application-identifier' in 'MyAppBundle.app/Contents/MacOS/MyAppExecutable' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.' followed by the bundle identifier.
This bundle is invalid. Apple is not currently accepting applications built with this version of the OS.
I've tried the following but none of them worked:
re-downloading and re-generating code signing certificates.
Specifying my team ID in the code signing parameters:
-i "(TEAMID).com.(mycompany).(myapp)" --entitlements "(MyAppEntitlementFile).entitlements"
Anybody can help? Thanks in advance.
I've fixed this by editing my entitlements file using Xcode's property list editor (not the fancy-looking GUI in the target's Summary tab) and remove the key named com.apple.application-identifier along with its value.
I'm not sure how that key-value pair got there in the first place because I'm quite confident that I didn't put it in there myself. This project was originally coded for Snow Leopard without sandboxing and went through a number of Xcode versions. Perhaps an old version of Xcode put it there and it conflicted with the newer one.

Problems in modifying and adding extension to firefox

I downloaded an extension from firefox renamed the xpi to zip and unpacked it. Then repacked the same folder using "zip" to create the xpi(sounds silly but i am planning on making modifications to the code, though i have not done in this case), howerver when i add that extension back to firefox, firefox is reporting the extension might be corrupt. I am running firefox in Mac OS X.
What is the problem?
I guess the error message is "This add-on could not be installed because it appears to be corrupt". That message appears for signed extensions if they have been modified - the very purpose of a signature is to prevent unauthorized modifications. You should remove META-INF directory before packing the extension back, that directory contains the signature. The extension will show up as unsigned then but I don't think you care.

Resources