cordova-plugin-firebase-analytics: ionic cordova build ios fails - Error code 65
I tried building my app in iOS for the first time after having added cordova-plugin-firebase-analytics, and I am getting the following error:
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build ios --release (exit code 1):
(truncated) ...
e.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c
-arch i386 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99
-fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/nafas/Library/Developer/Xcode/DerivedData/ModuleCache
-fmodules-prune-interval=86400 -fmodules-prune-after=345600
-fbuild-session-file=/Users/nafas/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation
-fmodules-validate-once-per-build-session -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers
-Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wduplicate-method-match
-Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter
-Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow
-Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion
-Wenum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match
-Wundeclared-selector -Wno-deprecated-implementations -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk
-fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.0 -g
-fvisibility=hidden -Wno-sign-conversion -Wno-infinite-recursion -fobjc-abi-version=2 -fobjc-legacy-dispatch
-iquote
/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/Updoc.build/Release-iphonesimulator/Updoc.build/Updoc-generated-files.hmap
-I/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/Updoc.build/Release-iphonesimulator/Updoc.build/Updoc-own-target-headers.hmap
-I/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/Updoc.build/Release-iphonesimulator/Updoc.build/Updoc-all-target-headers.hmap
-iquote
/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/Updoc.build/Release-iphonesimulator/Updoc.build/Updoc-project-headers.hmap
-I/Users/nafas/updoc/app/platforms/ios/build/emulator/include
-I/Users/nafas/updoc/app/platforms/ios/build/emulator/usr/local/lib/include
-I/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/UninstalledProducts/include
-I/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/UninstalledProducts/iphonesimulator/include
-I/Users/nafas/updoc/app/platforms/ios/build/emulator
-I/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/Updoc.build/Release-iphonesimulator/Updoc.build/DerivedSources/i386
-I/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/Updoc.build/Release-iphonesimulator/Updoc.build/DerivedSources
-F/Users/nafas/updoc/app/platforms/ios/build/emulator -include
/Users/nafas/updoc/app/platforms/ios/build/sharedpch/Updoc-Prefix-hdaupibbgcnigebntimpqhbbwlsk/Updoc-Prefix.pch
-MMD -MT dependencies -MF
/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/Updoc.build/Release-iphonesimulator/Updoc.build/Objects-normal/i386/CDVInAppBrowser.d
--serialize-diagnostics
/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/Updoc.build/Release-iphonesimulator/Updoc.build/Objects-normal/i386/CDVInAppBrowser.dia
-c /Users/nafas/updoc/app/platforms/ios/Updoc/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowser.m -o
/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/Updoc.build/Release-iphonesimulator/Updoc.build/Objects-normal/i386/CDVInAppBrowser.o
** BUILD FAILED **
The following build commands failed:
CompileC
/Users/nafas/Library/Developer/Xcode/DerivedData/Updoc-fklblfhvmnlqgpfrqmiiumwouyfz/Build/Intermediates/Updoc.build/Release-iphonesimulator/Updoc.build/Objects-normal/i386/FirebaseAnalyticsPlugin.o
Updoc/Plugins/cordova-plugin-firebase-analytics/FirebaseAnalyticsPlugin.m normal i386 objective-c
com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args:
-xcconfig,/Users/nafas/updoc/app/platforms/ios/cordova/build-release.xcconfig,-workspace,Updoc.xcworkspace,-scheme,Updoc,-configuration,Release,-sdk,iphonesimulator,-destination,platform=iOS
Simulator,name=iPhone
SE,build,CONFIGURATION_BUILD_DIR=/Users/nafas/updoc/app/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/nafas/updoc/app/platforms/ios/build/sharedpch
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 17
- Comments: 25
@pravs2011 same problem sample log :
To resolve this issue, I follow the first steps of this: https://github.com/firebase/quickstart-cpp/blob/master/analytics/testapp/readme.md#ios
I hope it will works for u.
iOS
platforms/ioson XCodeio.ionic.starterin all files for a unique identifierionic cordova run ios --device --livereload$ sudo ionic cordova build ios --release
I had same issue mostly when i tried to install the plugin i had an error Failed to install ‘cordova-plugin-firebase-analytics’:undefined Error: CocoaPods was not found. Please install version 1.0.1 or greater from https://cocoapods.org/.
My solution is to follow these steps:
Force to uninstall plugin “cordova plugin remove cordova-plugin-firebase-analytics --save” (until you get this error “Error: Plugin “cordova-plugin-firebase-analytics” is not present in the project. See
cordova plugin list.”So you must update your cocoapods following these steps “sudo gem install cocoapods” (to get last version of cocoapods) and “pod setup” (for sync new version into your OS)
Then, now you can reinstall plugin “cordova plugin add cordova-plugin-firebase-analytics --save”.
The build will be success
Note: my supposition of this plugin that you can build only with Xcode 8+ (because i have 7.2 and i had that issue)
After several (I mean several several) rounds of experimenting, reading and testing here are the steps I have found to clearly get out of this issue. It worked for 2 iOS Apps have I applied to. Hope it helps all.
if you get this below message when you try to install firebase-analytics in MAC, here is how you go about it.
Failed to install ‘cordova-plugin-firebase-analytics’: undefined
Failed to restore plugin “cordova-plugin-firebase-analytics” from config.xml. You might need to try adding it again. Error: /Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
I had to set the permission for the directory for everyone to read/write using getInfo menu item in MAC for that directory. This was because I don’t have all rights to files.
$ cordova plugin remove cordova-plugin-firebase-analytics --save Uninstalling cordova-plugin-firebase-analytics from ios
[!] The Podfile does not contain any dependencies.
Removing “cordova-plugin-firebase-analytics” Removing plugin cordova-plugin-firebase-analytics from config.xml file… Removing cordova-plugin-firebase-analytics from package.json
$ sudo gem install cocoapods Successfully installed cocoapods-1.5.3 Parsing documentation for cocoapods-1.5.3 Done installing documentation for cocoapods after 4 seconds 1 gem installed
$ pod setup Setting up CocoaPods master repo $ /usr/local/bin/git -C /Users/general/.cocoapods/repos/master fetch origin --progress remote: Counting objects: 12879, done. remote: Compressing objects: 100% (194/194), done. remote: Total 12879 (delta 5221), reused 5165 (delta 5165), pack-reused 7507 Receiving objects: 100% (12879/12879), 1.51 MiB | 321.00 KiB/s, done. Resolving deltas: 100% (8693/8693), completed with 1801 local objects. From https://github.com/CocoaPods/Specs 76a31b08e7c…7f76a16af16 master -> origin/master $ /usr/local/bin/git -C /Users/general/.cocoapods/repos/master rev-parse --abbrev-ref HEAD master $ /usr/local/bin/git -C /Users/general/.cocoapods/repos/master reset --hard origin/master Checking out files: 100% (1348/1348), done. HEAD is now at 7f76a16af16 [Add] LSiOSTableView 0.2.1 Setup completed
I had to set the permission for the directory for everyone to read/write using getInfo menu item in MAC for that directory. This was because I don’t have all rights to files.
$ vi platform/ios/Podfile ensure that in the Podfile the below shows pod ‘Firebase/Core’, ‘~> 4.1’
$ pod install Analyzing dependencies Downloading dependencies Installing Firebase (4.13.0) Installing FirebaseAnalytics (4.2.0) Installing FirebaseCore (4.0.20) Installing FirebaseInstanceID (2.0.10) Installing GoogleToolboxForMac (2.1.4) Installing nanopb (0.3.8) Generating Pods project Integrating client project Sending stats Pod installation complete! There is 1 dependency from the Podfile and 6 total pods installed.
I had to set the permission for the directory for everyone to read/write using getInfo menu item in MAC for that directory. This was because I don’t have all rights to files.
Note the 0.13.0 version of firebase-analytics used here
$ cordova plugin add cordova-plugin-firebase-analytics@0.13.0 --save Installing “cordova-plugin-firebase-analytics” for ios Adding cordova-plugin-firebase-analytics to package.json Saved plugin info for “cordova-plugin-firebase-analytics” to config.xml
I had to set the permission for the directory for everyone to read/write using getInfo menu item in MAC for that directory. This was because I don’t have all rights to files.
$ sudo ionic cordova build ios --release ** BUILD SUCCEEDED **
opened xcode using xcworkspace set device to generic ios device Shift+command+k - clean ok command+b - build ok connected iphone to MAC xcode automatically sets device to connected iphone Shift+command+k - clean ok command+b - build ok run app on device iphone crashed because the GoogleService-Info.plist was not found GoogleService-Info.plist file has to be in platform/ios folder manually copied GoogleService-Info.plist file to platform/ios folder Then added the GoogleService-Info.plist file using xcode project run app on device iphone worked fine this time
DISCONNECT iPHONE before running below command $ sudo ionic cordova build ios --release ** BUILD SUCCEEDED **
So, to avoid building Error, just make sure you CLOSE the Xcode window before you add the plugin, and open it only after building the app. This way all should work just fine.
Another issue comes up after though: The App terminates with the following error:
*** Terminating app due to uncaught exception 'com.firebase.core', reason: 'Default app has already been configured.'@bhumin3i your error looks different to the one the issue is about, although error code is the same. However, I’ve been getting exactly the same output as yours and found a workaround.
For some reason just re-adding the plugin fixes it for me. I added it to my npm postinstall script:
Hope this helps.
my ionic iOS build is failing
(node:13834) UnhandledPromiseRejectionWarning: Unhandled promise rejection.
> ionic cordova build ios is failing
After adding this plugin, the IOS build is failing, I am using this only for IOS app Tried everything, which is mentioned in the post but didn’t workout. Following below error I am getting after adding this plugin.
Packages version used: ionic - 3.19.1 cordova - 8.0.0
xcode - Version 9.2 macOS Sierra - 10.12.16
Can anybody help me out why I am getting this error ?