dpa99c / cordova-plugin-firebasex

Cordova plugin for Google Firebase
MIT License
571 stars 462 forks source link

Build failed for IOS #415

Closed darshitmaniar closed 4 years ago

darshitmaniar commented 4 years ago

Bug report

Getting error while building for IOS

BUILD FAILED I'm building a cordova project for iOS and I'm trying to add Firebase SDK. so I installed cordova-plugin-firebasex; I opened my .xcworkspace. then pod install in platforms/ios folder, went to the root directory and typed sudo cordova prepare ios; I updated the window in Xcode 11.3, went in Build Phases of target and checked the box 'Run scripts only when installing: When I am trying to build from Xcode11.3 by opening .xcworkspace I am getting below error

image

I also tried to replace the original path, i.e.

diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null to

diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null

and getting an below error:

/Volumes/DATA/ALD/_MyAldMobileApp_UAT/myALD2UAT/platforms/ios/My ALD-UAT/Plugins/cordova-plugin-firebasex/FirebasePlugin.h:3:9: 'Firebase.h' file not found

I tried do remove Podfile.lock and then pod install, tried to do pod deintegrate and pod clean, then again pod install, tried also pod repo update, Also I tried to upgrade and downgrade Cordova firebasex plugin and cocoapods versions. but still stuck and fail to build my project for iOS.

@dpa99c I tried example project but getting the same error as mentioned. Environment information

Cordova CLI version

9.0.0 (cordova-lib@9.0.1) Cordova platform version

Installed platforms: ios 5.1.1

Plugins & versions installed in project (including this plugin)

cordova-open-native-settings 1.5.2 "Native settings" cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx" cordova-plugin-androidx-adapter 1.1.1 "cordova-plugin-androidx-adapter" cordova-plugin-app-version 0.1.9 "AppVersion" cordova-plugin-camera 4.1.0 "Camera" cordova-plugin-device 2.0.3 "Device" cordova-plugin-firebasex 9.1.1 "Google Firebase Plugin" cordova-plugin-geolocation 4.0.2 "Geolocation" cordova-plugin-google-analytics 1.8.6 "Google Universal Analytics Plugin" cordova-plugin-inappbrowser 3.2.0 "InAppBrowser" cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview" cordova-plugin-network-information 2.0.2 "Network Information" cordova-plugin-splashscreen 5.0.3 "Splashscreen" cordova-plugin-statusbar 2.4.3 "StatusBar" cordova-plugin-whitelist 1.3.4 "Whitelist" cordova-plugin-x-socialsharing 5.6.8 "SocialSharing" es6-promise-plugin 4.2.2 "Promise"

iOS build issue:

Node JS version v10.15.3 XCode version 11.3

Since last three days I have tried lots of solutions to fix this issue but I failed to solved it. I have app release and currently I feel stuck in the middle of the ocean. I would highly appreciate solution to this issue.

dpa99c commented 4 years ago

The problem is highlighted in red in your screenshot - you Cocoapods installation is out of sync - try this:

pod repo update && cordova platform rm ios --nosave && cordova platform add ios --nosave

Closing as this is a support issue and not a plugin bug.

darshitmaniar commented 4 years ago

Thanks for the reply.. I tried your with your suggestion but when I tried to add platform I am getting below error in you example project.

sudo cordova platform add ios --nosave Using cordova-fetch for cordova-ios@^5.0.1 Adding ios project... Creating Cordova project for the iOS platform: Path: platforms/ios Package: uk.co.workingedge.firebase.test Name: FirebaseTest iOS project created with cordova-ios@5.1.1 Installing "cordova-custom-config" for ios Installing "cordova-plugin-androidx" for ios Installing "cordova-plugin-androidx-adapter" for ios Installing "cordova-plugin-customfcmreceiver" for ios Installing "cordova-plugin-dialogs" for ios Installing "cordova-plugin-enable-multidex" for ios Installing "cordova-plugin-firebasex" for ios Plugin dependency "cordova-plugin-androidx@1.0.2" already fetched, using that version. Dependent plugin "cordova-plugin-androidx" already installed on ios. Plugin dependency "cordova-plugin-androidx-adapter@1.1.1" already fetched, using that version. Dependent plugin "cordova-plugin-androidx-adapter" already installed on ios. Failed to install 'cordova-plugin-firebasex': undefined CordovaError: Promise rejected with non-error: '/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:439:inhelp!\': \u001b[31m[!] You cannot run CocoaPods as root.\u001b[39m (CLAide::Help)\n\n\u001b[4mUsage:\u001b[24m\n\n $ \u001b[32mpod\u001b[39m \u001b[32mCOMMAND\u001b[39m\n\n CocoaPods, the Cocoa library package manager.\n\n\u001b[4mCommands:\u001b[24m\n\n \u001b[32m+ cache\u001b[39m Manipulate the CocoaPods cache\n \u001b[32m+ env\u001b[39m Display pod environment\n \u001b[32m+ init\u001b[39m Generate a Podfile for the current directory\n \u001b[32m+ install\u001b[39m Install project dependencies according to versions from a\n Podfile.lock\n \u001b[32m+ ipc\u001b[39m Inter-process communication\n \u001b[32m+ lib\u001b[39m Develop pods\n \u001b[32m+ list\u001b[39m List pods\n \u001b[32m+ outdated\u001b[39m Show outdated project dependencies\n \u001b[32m+ repo\u001b[39m Manage spec-repositories\n \u001b[32m+ setup\u001b[39m Setup the CocoaPods environment\n \u001b[32m+ spec\u001b[39m Manage pod specs\n \u001b[32m+ update\u001b[39m Update outdated project dependencies and create new Podfile.lock\n\n\u001b[4mOptions:\u001b[24m\n\n \u001b[34m--silent\u001b[39m Show nothing\n \u001b[34m--version\u001b[39m Show the version of the tool\n \u001b[34m--verbose\u001b[39m Show more debugging information\n \u001b[34m--no-ansi\u001b[39m Show output without ANSI codes\n \u001b[34m--help\u001b[39m Show help banner of specified command\n\tfrom /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.2/lib/cocoapods/command.rb:47:in run\'\n\tfrom /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.2/bin/pod:55:in<top (required)>\'\n\tfrom /usr/local/bin/pod:23:in load\'\n\tfrom /usr/local/bin/pod:23:in

\'\n' at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:29:15) at process._tickCallback (internal/process/next_tick.js:68:7)`

dpa99c commented 4 years ago

You cannot run CocoaPods as root