Is it possible to build Authorization Plugins using Cocoapods?

I'm working on building an Authorization Plugin and when I try to link to cod from a Pod, the plugin crashes on invocation. For example, I tried linking to the SQLite library, GRBD. The error in the console logging is as follows:

SecurityAgentHelper-arm64: (CoreFoundation) Error loading /Library/Security/SecurityAgentPlugins/TestAuthPlugin.bundle/Contents/MacOS/TestAuthPlugin:  dlopen(/Library/Security/SecurityAgentPlugins/TestAuthPlugin.bundle/Contents/MacOS/TestAuthPlugin, 0x0106): Library not loaded: '@rpath/GRDB.framework/Versions/A/GRDB'
  Referenced from: '/Library/Security/SecurityAgentPlugins/TestAuthPlugin.bundle/Contents/MacOS/TestAuthPlugin'
  Reason: tried: '/Library/Security/SecurityAgentPlugins/TestAuthPlugin.bundle/Contents/MacOS/Frameworks/GRDB.framework/Versions/A/GRDB' (no such file), '/Library/Security/SecurityAgentPlugins/TestAuthPlugin.bundle/Contents/MacOS/../Frameworks/GRDB.framework/Versions/A/GRDB' (no such file), '/Library/Security/SecurityAgentPlugins/TestAuthPlugin.bundle/Contents/MacOS/Frameworks/GRDB.framework/Versions/A/GRDB' (no such file), '/Library/Security/SecurityAgentPlugins/TestAuthPlugin.bundle/Contents/MacOS/../Frameworks/GRDB.framework/Versions/A/GRDB' (no such file), '/System/Library/Frameworks/GRD<…>

Indeed, if I look in the .bundle, I don't see GRDB anywhere. I'm including the Pods .framework file using "Embed without signing."

Note that I can get this to work if I include GRDB using Swift Package Manager. For our project it may be fine to use SPM, but I'm interested in knowing if pods are an option at all.

Thanks, Francis

I'll answer my own question in case it's relevant for others. I had use_frameworks! in my Podfile. Once I removed that and rebuilt the .bundle, it worked.

In theory you could nest a framework within an auth plug-in and load it successfully, but it seems that CocoaPods isn’t setting that up right. However, the solution you posted, which I presume switches you over to using a static library to embed the code directly in your plug-in, is probably the better choice.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is it possible to build Authorization Plugins using Cocoapods?
 
 
Q