dpa99c / cordova-plugin-firebasex

Cordova plugin for Google Firebase
MIT License
569 stars 461 forks source link

Failed to install 'cordova-plugin-firebasex': undefined (Cannot run CocoaPods as root) #163

Closed ctfrancia closed 4 years ago

ctfrancia commented 4 years ago

Bug report

Current behavior:

Currently I cannot add the plugin to the project with ios. all the other plugs install correctly on ios and android, however, when arriving to ios with this plugin I get this error.

Expected behavior:

I don't know how this could be a problem with my code as all others work. I understand that it says that 'unable to CocoaPods as root` but with all the other files cocoapods has no problem installing. Why what makes this plugin different? That's why I think that there might be a problem with the plugin.

Steps to reproduce:

Screenshots

Environment information

- Plugins & versions installed in project (including this plugin)
    - `cordova plugin ls`

com-badrit-base64 0.2.0 "Base64" cordova-android-support-gradle-release 2.1.0 "cordova-android-support-gradle-release" cordova-open-native-settings 1.5.2 "Native settings" cordova-plugin-android-permissions 1.0.0 "Permissions" cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx" cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter" cordova-plugin-camera 4.0.3 "Camera" cordova-plugin-device 2.0.2 "Device" cordova-plugin-file 6.0.1 "File" cordova-plugin-file-transfer 1.7.1 "File Transfer" cordova-plugin-firebasex 6.1.0 "Google Firebase Plugin" cordova-plugin-googleplus 8.0.0 "Google SignIn" cordova-plugin-inappbrowser 3.0.0 "InAppBrowser" cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 4.1.1 "cordova-plugin-ionic-webview" cordova-plugin-splashscreen 5.0.2 "Splashscreen" cordova-plugin-statusbar 2.4.2 "StatusBar" cordova-plugin-whitelist 1.3.3 "Whitelist" cordova-plugin-x-socialsharing 5.4.7 "SocialSharing" cordova-sqlite-storage 3.2.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version" cordova.plugins.diagnostic 4.0.12 "Diagnostic" es6-promise-plugin 4.2.2 "Promise" onesignal-cordova-plugin 2.6.0 "OneSignal Push Notifications"

- Dev machine OS and version, e.g.
    - OSX
        - `sw_vers`

ProductName: Mac OS X ProductVersion: 10.14.6 BuildVersion: 18G95

    - Windows 10
        - `winver`

_Runtime issue_
- Device details
    - _e.g. iPhone X, Samsung Galaxy S8, iPhone X Simulator, Pixel XL Emulator_
- OS details
    - _e.g. iOS 12.2, Android 9.0_  

_Android build issue:_  
- Node JS version
    - `node -v`
- Gradle version
    - `ls platforms/android/.gradle`
- Target Android SDK version
    - `android:targetSdkVersion` in `AndroidManifest.xml`
- Android SDK details
    - `sdkmanager --list | sed -e '/Available Packages/q'`

_iOS build issue:_
- Node JS version
    - `node -v`
- XCode version

**Related code:**

insert any relevant code here such as plugin API calls / input parameters


**Console output**
<details>
<summary>console output/installs others to Podfile</summary>

Podfile found in platforms/ios Install complete for cordova-plugin-file-transfer on ios. Finding scripts for "after_plugin_install" hook from plugin cordova-plugin-file-transfer on ios platform only. No scripts found for hook "after_plugin_install". Installing plugin "cordova-plugin-firebasex" following successful platform add of ios Found variables for "cordova-plugin-firebasex". Processing as cli_variables. Installing "cordova-plugin-firebasex" for ios Running command: /Users/c.francia/Desktop/dicus/dicus/application/app/platforms/ios/cordova/version Command finished with error code 0: /Users/c.francia/Desktop/dicus/dicus/application/app/platforms/ios/cordova/version Running command: /Users/c.francia/Desktop/dicus/dicus/application/app/platforms/ios/cordova/version Command finished with error code 0: /Users/c.francia/Desktop/dicus/dicus/application/app/platforms/ios/cordova/version Dependencies detected, iterating through them... Requesting plugin "cordova-plugin-androidx@^1.0.2". Plugin dependency "cordova-plugin-androidx@1.0.2" already fetched, using that version. Dependent plugin "cordova-plugin-androidx" already installed on ios. Requesting plugin "cordova-plugin-androidx-adapter@^1.1.0". Plugin dependency "cordova-plugin-androidx-adapter@1.1.0" already fetched, using that version. Dependent plugin "cordova-plugin-androidx-adapter" already installed on ios. Finding scripts for "before_plugin_install" hook from plugin cordova-plugin-firebasex on ios platform only. No scripts found for hook "before_plugin_install". Install start for "cordova-plugin-firebasex" on ios. Beginning processing of action stack for ios project... Action stack processing complete. pods.json found in platforms/ios Podfile found in platforms/ios Adding pods since the plugin contained Set pods.json for declarations - use_frameworks! Added declaration line for use_frameworks! Set pods.json for sources - https://github.com/CocoaPods/Specs.git Added source line for https://github.com/CocoaPods/Specs.git Set pods.json for libraries - Firebase/Core Added pod line for Firebase/Core Set pods.json for libraries - Firebase/Auth Added pod line for Firebase/Auth Set pods.json for libraries - Firebase/Messaging Added pod line for Firebase/Messaging Set pods.json for libraries - Firebase/Performance Added pod line for Firebase/Performance Set pods.json for libraries - Firebase/RemoteConfig Added pod line for Firebase/RemoteConfig Set pods.json for libraries - Fabric Added pod line for Fabric Set pods.json for libraries - Crashlytics Added pod line for Crashlytics Wrote to pods.json. Wrote to Podfile. Running pod install (to install plugins) Failed to install 'cordova-plugin-firebasex': undefined CordovaError: Promise rejected with non-error: "/Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:439:in help!': \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.3.0/gems/cocoapods-1.7.5/lib/cocoapods/command.rb:47:inrun'\n" + "\tfrom /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/bin/pod:55:in <top (required)>'\n" + "\tfrom /usr/local/bin/pod:22:inload'\n" + "\tfrom /usr/local/bin/pod:22:in `

'\n" at /usr/local/lib/node_modules/cordova/bin/cordova:29:15 at processTicksAndRejections (internal/process/task_queues.js:85:5) [ERROR] An error occurred while running subprocess cordova.

    cordova platform add ios --verbose exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms ionic:utils-process onBeforeExit handler: running 1 functions +0ms ionic:utils-process processExit: exiting (exit code: 1) +45ms



</details><br/><br/>

**Other information:**

<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->

<!--
A POLITE REMINDER

- This is free, open-source software. 
- Although the author makes every effort to maintain it, no guarantees are made as to the quality or reliability, and reported issues will be addressed if and when the author has time. 
- Help/support will not be given by the author, so forums (e.g. Ionic) or Stack Overflow should be used. Any issues requesting help/support will be closed immediately.
- If you have urgent need of a bug fix/feature, the author can be engaged for PAID contract work to do so: please contact dave@workingedge.co.uk
- Rude or abusive comments/issues will not be tolerated, nor will opening multiple issues if those previously closed are deemed unsuitable. Any of the above will result in you being BANNED from ALL of my Github repositories.
-->
dpa99c commented 4 years ago

Please try building the example project to rule out conflicts with other plugins in your project and to validate your build environment.

ctfrancia commented 4 years ago

Alright, it says that the build was successful... which means there is nothing more you can do for me, thanks anyways 😭

dpa99c commented 4 years ago

Thanks for you reply

sametacar commented 4 years ago

how did you fix the issue @ctfrancia ?

sajberek commented 4 years ago

Hi,

I installed example project clean. I ran: npm install sudo cordova platform add ios

It gave me this error: Failed to install 'cordova-plugin-firebasex': undefined Failed to restore plugin "cordova-plugin-firebasex" from config.xml. You might need to try adding it again. Error: /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)

sametacar commented 4 years ago

@sajberek I faced some problems like you, and I used firebasex for android, and firebase for ios. it is silly yeap, but it worked.