Build firebreath plugin with XCode - xcode

I used prep script to generate my first plugin project, build the plugin and create a symlink in ~/Library/Internet Plugins/(exactly as the mac tutorial videos show). Every time I start a browser(Firefox, Chrome or Safari) and then close it, Xcode always alerted me that "the project file "~.xcodeproj" is modified but was changed externally. Keep this version or read from disk?"
I just can't figure out why?

So first of all, just for clarity, this is either a cmake issue or an xcode issue, not a FireBreath issue. I have never seen it happen before. The main thing I would try is to delete the build/ directory entirely and then re-run the prep script (which just runs cmake) and see if the problem persists.
If it does, most likely it's something odd with your computer configuration, and specifically your xcode configuration. :-/ I wish I could give you a better suggestion. You're also welcome to drop into the #firebreath IRC room at http://npapi.com/chat and we'll try to help you there.

i flow firebreath doc, create a symlink of plugin to ~/Library/Internet Plugins, but safari and firefox all not load the plugin.
but i cp the plugin package to ~/Library/Internet Plugins, and all browsers work.

Related

AudioKit 4.11.2 Playgrounds: "No such module AudioKitPlaygrounds"

It has been a year since updating so I downloaded AudioKit 4.11.2 yesterday. I built all of the frameworks, including the AudioKit and AudioKitUI xcframeworks.
Then I began playing with the Playgrounds. Right away Xcode tells me the build failed because it can't find the AudioKit frameworks. It appears that the Search Paths that are set in the original project file need tweaking so I set it to "$(inherited)../Frameworks".
Now it builds but still will not run, saying on the import AudioKitPlaygrounds statement that there is No such module AudioKitPlaygrounds.
Odd, because that is the target of the build and it exists in the Derived Data Products folder.
Searching through StackOverflow shows that AudioKit has had similar problems like this in the past but none of the proposed solutions seemed relevant to my situation.
What other tricks are necessary to get the Playgrounds running? Shouldn't it build and run straight out of the box without messing with the project search paths?
My environment is:
macOS 10.15.6
MacBookPro
Xcode 12.0.1
I ran through a similar problem with macOS 10.15.7, XCode 12.1 and AudioKit 4.11.2.
I got the same “No such module AudioKitPlaygrounds” message.
The "Build Active Scheme" option was unchecked in my File Inspector >> Playground Settings, so I checked it, rebuild the "Introduction and Hello World" .playground and it worked.
Edit (04/15/2021): David Thery gave a more complete answer in the following answers.
Also, make sure to:
run 'pod install' + automatically converting to swift5 in XCode
check "Build Active Scheme" as mentioned by Miguel FOR EACH single playgrounds you want to run.
run the playground with the play button in the editor, not the xcode main run button
If you want instead to use AudioKit in another XCode project, only two steps:
download AudioKit and AudioKitUI frameworks from here:
embed them in General > Frameworks, Libraries, and Embedded content, as shown on the screenshot below.
How did you build the frameworks? The assumption when it comes to the paths in other projects (including Playgrounds) is that they have been built via the build_frameworks.sh and build_xcframework.sh scripts in the Frameworks directory.
The end result should be a set of XCFrameworks in that same Frameworks directory, which is in turn referenced by examples and the playgrounds project.
To anyone still experiencing this issue, I just found a really simple solution. I was opening my playground files directly from 'Open Recent'. Problem is, Xcode doesn't automatically look at the parent directory and included files. Just close Xcode and open the AudioKitPlaygrounds.xcodeproj from finder. When you open your playground files from there they should work properly.

Xcode Source Compiling Order Issue

I am working on a fork of the Xbox HID project (to allow greater configuration of the controller) and came across a really strange issue.
The project is three projects, which I have grouped together under a workspace, which works well, it compiles them in order (kext, daemon and prefpane) and all works.
However, I decided to uncrustify the code (thanks Alcatraz!) and standardise the names and locations of source files. This required me to update the project as file paths changed.
Once this was all completed the PrefPane wouldn't load. For some reason it was instantiating and sending initWithBundle to an object that was NOT the File's Owner in the XIB.
After a lot of debugging and hair-pulling I discovered the object it was instantiating also happened to be the first file listed in the Compile Sources build phase. Once I moved the correct file to the top of that list the PrefPane once again launched and worked as expected.
That seems wrong, why does it need to compile this particular class first... better yet, why is it picking up only the first compiled class instead of the one specified in the XIB?
I am using Xcode Version 6.2 (6C131e) under OSX 10.9.5, however, I am using the OSX 10.6 SDK and have 10.6 as the deployment target.
I was having some other issues with the project in question, so I rebuilt all three projects and this issue went away.
I am guessing there was some sort of issue with the Xcode project itself as I believe it was probably upgraded from at least two previous major versions of Xcode.
Lesson here seems to be, rebuild the project files themselves and see if that fixes the issues!

Is it a sandbox issue? how to fix it? (I am implementing a plugin of apple mail)

Maybe this tutorial is out of date( it was written in 2009),but I cannot find a better one. While following it step by step, I was stuck at Loading a Plugin section. Apple mail failed to load the plugin.
here is a screenshot of Console's information.
Has anybody else tried to follow this tutorial on OS X 10.9 recently?
////////////////////update/////////////////////////
It seems "~/Library/Mail/Bundles/MyPlugin.mailbundle/Contents/Frameworks/Python.framework/Versions/2.7/python" needs code signing.
Yes, this is a sandbox problem: Python Mail plug-ins (and I think all plug-ins) cannot read files outside of their container (the Plugin.mailbundle directory).
If you followed the instructions on the tutorial page you mention, you are probably building an alias build of the plug-in (using python setup.py py2app -A), which means that the plug-in will try and access files from the original source location, which is almost always outside of the sandbox (in your case, it's /Users/greedyint/Desktop).
Try running without -A to make a full build.

Installing and Using Pantomime Framework... Pantomime/Pantomime.h not found

I just downloaded and compiled Pantomime for SMTP use in my Cocoa Application. The first issue was that it is old... so I changed the build settings to use the most recent SDK as well as eliminate the old PPC build settings.
After those changes, everything compiled nicely (or at least appeared to do so.)
Next, I installed the Pantomime.framework into the /Library/Frameworks directory per Apple documentation recommendations.
Then, I imported the framework into my project under the Build Phases tab where it says "Link Binaries to Libraries".
So far everything seemed to work as it did with WebKit.framework, and ScriptingBridge.framework.
Finally, I added the following to my code:
#import <Pantomime/Pantomime.h>
I got as far as "Pa" when it auto completed the rest, so it apparently knows what I'm looking for. However, when I try to compile my code, I receive the following error:
Lexical or Preprocessor Issue "Pantomime/Pantomime.h" file not found.
All of the other frameworks seemed to work, but this one does not, and I really don't know why (I'm relatively new to working with frameworks.)
Anyone have any ideas on what I'm doing wrong here?
Thanks!
I've never used Pantomime, but this happens to me all the time with Xcode, so although I'm a newbie to development in general I'd wager it's just a bug with Xcode. Here's how I fix it:
In Xcode, hit command-1 to switch to the Navigator's file/folder view.
Reveal the Pantomime.h and .m files in the Finder, wherever you've stored them.
Drag them into the Navigator.
Xcode will prompt you to confirm adding again, and I usually leave it set as is to "copy files if needed".
Xcode will import. You should then delete the old references in the Navigator. It should work fine after that.
I have met this problem.
The solution is setting 'Build Settings' --> 'Header Search Path' Value where your pantomime is. Good luck!

firebreath firefox plugin not found MACOSX

I have been following the following firebreath tutorial:
http://www.firebreath.org/display/documentation/Mac+Video+Tutorial
And in the second video, After i have built my plugin and i am including the ScreenTutorialPlugin.plugin file in the /Library/Internet/Plug-ins section, it doesn't show in firefox, when i go check it in about:plugins, it just doesnt show. But in the terminal when i go check /Library/Internet/Plug-ins, it does show.
when i open a plugin file and it opens in the browser, it says that the plugin doesnt work.
i think this has to do with the file linking part ln -s in the /plug-ins section.
or could the reason be that i use 3 different browsers? safari,firefox and chrome.
Thank you
With the information provided it is difficult to be certain what your issue is, but here are a few things to consider / understand:
FireBreath plugins are NPAPI plugins and thus should work on all three of the browsers you mentioned
The path where it should be installed is "/Library/Internet Plugins", not "/Library/Internet/Plugins" and if you have actually placed it in the latter directory as you indicated and that isn't a typo then this is definitely part of your issue
using ln -s should work if you create a symlink to the actual .plugin directory, but if it doesn't you can always try copying the file itself
If everything built correctly you should have a binary called (plugin name).plugin/Contents/MacOS/(plugin name) where (plugin name) is the name of your plugin
Hopefully some of this helps; if it doesn't, please provide more information about what you have tried and we'll try to help some more. What you are doing definitely should work -- I use plugins created by FireBreath on Mac every day.

Resources