Hissvard
Hissvard

Reputation: 465

cordova-plugin-facebook4 - iOS build fails with error code 65, probably because of missing native dependencies

phonegap build ios fails with the following error message:

The following build commands failed:
    CompileC /Users/user/Library/Developer/Xcode/DerivedData/MyApp-dtsdztgswtsnnubosnumqjssdpaj/Build/Intermediates.noindex/MyApp\ App.build/Debug-iphonesimulator/MyApp\ App.build/Objects-normal/x86_64/FacebookConnectPlugin.o /Applications/MAMP/htdocs/MyApp/platforms/ios/MyApp\ App/Plugins/cordova-plugin-facebook4/FacebookConnectPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Command finished with error code 65: xcodebuild -workspace,MyApp.xcworkspace,-scheme,MyApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 11 Pro Max,build,CONFIGURATION_BUILD_DIR=/Applications/MAMP/htdocs/MyApp/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Applications/MAMP/htdocs/MyApp/platforms/ios/build/sharedpch


(node:3817) UnhandledPromiseRejectionWarning: Error: xcodebuild: Command failed with exit code 65
    at ChildProcess.whenDone (/Applications/MAMP/htdocs/MyApp/node_modules/cordova-common/src/superspawn.js:135:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

(node:3817) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3817) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

These are my plugin versions:

Additional Context

I managed to solve the issue by manually editing my Podfile and adding the following lines to it, then running cd platforms/ios && pod install:

pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'

After that, phonegap build ios completed succesfully.

Could it be that somehow native dependencies aren't being added? It would be ideal not having to add these back every time I remove and re-add the platform, and adding them in a build hook sounds veeeeeeery hacky.

Upvotes: 2

Views: 1786

Answers (2)

Cristian Scheel
Cristian Scheel

Reputation: 878

This means that you have an error on App/Plugins/cordova-plugin-facebook4/FacebookConnectPlugin.m

if you go to xcode and check that file , you will see the missing classes. I think that you are using a SDK not supported by the plugin, so I recommend you to change to cordova-plugin-facebook-connect that support last facebook sdks (9.0.0) https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect#readme

Upvotes: 1

Jaydeep Kataria
Jaydeep Kataria

Reputation: 867

In my case i have permission related issue so that's why i give permission to ($user)/.cocoapods but not working

then i have delete that folder and then pod install command fire in ($app_folder)/platform/ios and

it will install all the files of facebook 'FBSDKCoreKit','FBSDKLoginKit','FBSDKShareKit' in to the ios platform

might it will help you too.

Upvotes: 2

Related Questions