Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS build failed with Command PhaseScriptExecution failed exit code 65 #451

Closed
kunalkakkad opened this issue Jul 13, 2020 · 8 comments
Closed
Labels
build issue An issue related to build process ios relates to iOS platform support Support is being requested but not a necessarily a bug

Comments

@kunalkakkad
Copy link

Bug report

Current behavior:

After I add cordova-plugin-firebasex ios build failed with following error:

ios/Pods/FirebaseCrashlytics/run: /bin/sh^M: bad interpreter: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code

Expected behavior:

Should build it successfully

Steps to reproduce:

  • Remove platform ionic cordova platform rm ios
  • Add plugin ionic cordova plugin add cordova-plugin-firebasex
  • Add platform ionic cordova platform add ios@5
  • Build ionic cordova build ios

Screenshots

Screenshot 2020-07-13 at 12 24 10 PM

Environment information

Installed platforms:
  ios 5.1.1
Available platforms: 
  android ^8.0.0
  browser ^6.0.0
  electron ^1.0.0
  osx ^5.0.0
  windows ^7.0.0
  • Plugins & versions installed in project (including this plugin)
cordova-plugin-androidx 2.0.0 "cordova-plugin-androidx"
cordova-plugin-androidx-adapter 1.1.1 "cordova-plugin-androidx-adapter"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-facebook4 6.4.0 "Facebook Connect"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-firebasex 10.1.0-cli "Google Firebase Plugin"
cordova-plugin-inapppurchase 1.1.0 "In App Purchase"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-media 5.0.3-dev "Media"
cordova-plugin-screen-orientation 3.0.2 "Screen Orientation"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
nl.x-services.plugins.backgroundaudio 1.0.1 "BackgroundAudio"
  • Dev machine OS and version, e.g.
    • OSX
ProductName:	Mac OS X
ProductVersion:	10.15.5
BuildVersion:	19F101

iOS build issue:

  • Node JS version
    • v12.16.3
  • XCode version
    • 11.5 (11E608c)

Console output

console output

PhaseScriptExecution Crashlytics /Users/fp/Library/Developer/Xcode/DerivedData/Ontspan_Sessies-cmqpcyryezfaauglokeigarbxnpl/Build/Intermediates.noindex/Ontspan\ Sessies.build/Debug-iphonesimulator/Ontspan\ Sessies.build/Script-243D2868E6954C6A88FF6A59.sh (in target 'Ontspan Sessies' from project 'Ontspan Sessies')
    cd /Users/fp/Work/ontspan_app/ontspan/platforms/ios
    /bin/sh -c /Users/fp/Library/Developer/Xcode/DerivedData/Ontspan_Sessies-cmqpcyryezfaauglokeigarbxnpl/Build/Intermediates.noindex/Ontspan\\\ Sessies.build/Debug-iphonesimulator/Ontspan\\\ Sessies.build/Script-243D2868E6954C6A88FF6A59.sh
/Users/fp/Library/Developer/Xcode/DerivedData/Ontspan_Sessies-cmqpcyryezfaauglokeigarbxnpl/Build/Intermediates.noindex/Ontspan Sessies.build/Debug-iphonesimulator/Ontspan Sessies.build/Script-243D2868E6954C6A88FF6A59.sh: /Users/fp/Work/ontspan_app/ontspan/platforms/ios/Pods/FirebaseCrashlytics/run: /bin/sh^M: bad interpreter: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code

** BUILD FAILED **


The following build commands failed:
        PhaseScriptExecution Crashlytics /Users/fp/Library/Developer/Xcode/DerivedData/Ontspan_Sessies-cmqpcyryezfaauglokeigarbxnpl/Build/Intermediates.noindex/Ontspan\ Sessies.build/Debug-iphonesimulator/Ontspan\ Sessies.build/Script-243D2868E6954C6A88FF6A59.sh
(1 failure)
xcodebuild: Command failed with exit code 65
[ERROR] An error occurred while running subprocess cordova.
        
        cordova build ios exited with exit code 65.
        
        Re-running this command with the --verbose flag may provide more information.



Other information:

  • Ionic Info
Ionic:

   Ionic CLI                     : 6.9.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 4.11.10
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 11 other plugins)

Utility:

   cordova-res (update available: 0.15.1) : 0.14.0
   native-run                             : not installed

System:

   ios-deploy : 1.10.0
   ios-sim    : 8.0.2
   NodeJS     : v12.16.3 (/usr/local/bin/node)
   npm        : 6.14.4
   OS         : macOS Catalina
   Xcode      : Xcode 11.5 Build version 11E608c

Also I have tried sudo gem install cocoapods-dependencies and pod install , but no success. Without this plugin project builds properly.

Any help is appreciated.
Thanks,

@dpa99c
Copy link
Owner

dpa99c commented Jul 13, 2020

The actual cause of the build failure is:

/bin/sh^M: bad interpreter: No such file or directory

Please try building and running the example project which is a known working codebase to see if you can replicate the issue there.

Also run pod repo update to ensure you local Cocopods repo is up-to-date.

@dpa99c dpa99c added build issue An issue related to build process ios relates to iOS platform support Support is being requested but not a necessarily a bug labels Jul 13, 2020
@kunalkakkad
Copy link
Author

The actual cause of the build failure is:

/bin/sh^M: bad interpreter: No such file or directory

Please try building and running the example project which is a known working codebase to see if you can replicate the issue there.

Also run pod repo update to ensure you local Cocopods repo is up-to-date.

Thanks for the quick reply.
As you said the actual cause of build failure is no such file or directory but this error occurs only when i install the plugin otherwise it works fine.

Also trying to run on the demo project you have provided the link of.

PS: I have ran pod repo update already but no luck.

@dpa99c
Copy link
Owner

dpa99c commented Jul 13, 2020

This is something specific to your environment as it's not affecting my builds, other members of my team or other users of this plugin.

There are some suggestions to resolve this issue here: CocoaPods/CocoaPods#8955

@kunalkakkad
Copy link
Author

kunalkakkad commented Jul 14, 2020

This is something specific to your environment as it's not affecting my builds, other members of my team or other users of this plugin.

There are some suggestions to resolve this issue here: CocoaPods/CocoaPods#8955

Hello,

I tried with test project and facing issue in it also as below:

Screenshot 2020-07-14 at 12 15 55 PM

Any help is appreciated.

PS: I ran pod install and still the error persist.

@dpa99c
Copy link
Owner

dpa99c commented Jul 14, 2020

To resolve this error use the CLI version of the plugin for CLI builds - see Cordova CLI builds and #326.

@dpa99c dpa99c closed this as completed Jul 14, 2020
@kunalkakkad
Copy link
Author

To resolve this error use the CLI version of the plugin for CLI builds - see Cordova CLI builds and #326.

Yes I tried to use CLI version but then faced the original error which I reported in this issue.
So is there any workaround for the same to resolve this?

Thanks in advance.

@kunalkakkad
Copy link
Author

Hello,

It was the issue with the file formatting issue with the file in platform > ios > Pods > FirebaseCrashlytics > run
I have resolved the same by following steps:

  • Install dos2unix brew install dos2unix
  • Execute command dos2unix path_to_run_file path_to_run_file_after_fixing

Hope it may be useful for others.

@gburic
Copy link

gburic commented Nov 11, 2024

Thanks for posting this suggestion, this resolved my issue also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build issue An issue related to build process ios relates to iOS platform support Support is being requested but not a necessarily a bug
Projects
None yet
Development

No branches or pull requests

3 participants