Creating an iPA using command line for a Phonegap project - ios

I used the following instructions http://docs.phonegap.com/en/2.0.0/guide_command-line_index.md.html#Command-Line%20Usage for setting up the command line tools for iOS.
But when I try to build the project with $ /path/to/my_new_cordova_project/cordova/debug
I get this:
In file included from /Users/jakob/Dropbox/Coding/phonegap/ios_project/ios_project/Classes/AppDelegate.m:28:
/Users/jakob/Dropbox/Coding/phonegap/ios_project/ios_project/Classes/AppDelegate.h:30:9: fatal error: 'Cordova/CDVViewController.h' file not found
#import <Cordova/CDVViewController.h>
^
1 error generated.
** BUILD FAILED **
The following build commands failed:
CompileC build/ios_project.build/Debug-iphonesimulator/ios_project.build/Objects-normal/i386/MainViewController.o ios_project/Classes/MainViewController.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/ios_project.build/Debug-iphonesimulator/ios_project.build/Objects-normal/i386/AppDelegate.o ios_project/Classes/AppDelegate.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
When I build the project with Xcode everything works fine but I´d prefer to use the command line tools.
I got:
Xcode 5.0
PhoneGap 2.9.1 and I have tried in 3.4.0

This error appears probably by using the workspace file. Trying with the xcode project directory should resolve the problem.

Related

Ionic 3 iOS release build failing

I am trying to build(release) my ionic 3 apps for iOS. I was able to do it earlier without any problem but all of a sudden I started to get below errors
/Users/akash/Desktop/sourcecode /platforms/ios/Xpym/Plugins/cordova-plugin-ionic-webview/CDVWKWebViewEngine.h:21:9: fatal error: 'Cordova/CDV.h' file not found
#import <Cordova/CDV.h>
1 error generated.
** BUILD FAILED **
The following build commands failed:
CompileC /Users/akash/Library/Developer/Xcode/DerivedData/Xpym-bvfukasejehwgkcvbzmyfdzldbzg/Build/Intermediates.noindex/Xpym.build/Release-iphonesimulator/Xpym.build/Objects-normal/x86_64/IONAssetHandler.o
/Users/akash/Desktop/sourcecode\
/platforms/ios/Xpym/Plugins/cordova-plugin-ionic-webview/IONAssetHandler.m
normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure) xcodebuild: Command failed with exit code 65
I have tried removing node_modules folder and reinstalling them, reinstalling ios platform but I am now continuously getting this error.
But when I build it without --release, the build is successful.

React Native getting start project IOS build failed

I am getting following errors while creating first React Native project (AwesomeProject). I have run this project on Android and it is working as expected. Please find the attached snapshots and guide me what is going wrong with IOS.
I was using Xcode 8 when getting errors I also updated my Xcode to 9.0 and Node etc.. but nothing got worked and all errors are same as I am getting since from start.
** BUILD FAILED **
The following build commands failed:
CompileC /Users/clines291/RNProjects/AwesomeProject/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/Conv.o/Users/clines291/RNProjects/AwesomeProject/node_modules/react-native/third-party/folly-2016.09.26.00/folly/Conv.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/clines291/RNProjects/AwesomeProject/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/StringBase.o /Users/clines291/RNProjects/AwesomeProject/node_modules/react-native/third-party/folly-2016.09.26.00/folly/StringBase.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug- iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Attachments:
Visual Code build failed error
Xcode build failed errors
Versions:
Xcode: 9.0
Node: v8.6.0
Homebrew: 1.3.5
Watchman: 4.9.0
react-native-cli: 2.0.1
react-native: 0.49.3
npm: 5.3.0
have you tried using xcode 8 rather than xcode 9?
or if you still want to use xcode 9
try this
rm -r ~/.rncache/
cd node_modules/react-native/third-party/glog-0.3.4/
./configure --host arm-apple-darwin
I found this solution on below mentioned link:
https://github.com/facebook/react-native/issues/14368
react-native init [PROJECT_NAME] --version 0.44.0
This is C compiler problem
open xcode, select Build Settings > Build options,
then enable c compiler works me.

React Native Firebase build error

I've been struggling with getting my react native instance to run and i keep hitting this:
** BUILD FAILED **
The following build commands failed:
CompileC /Users/alexvallejo/Sites/myProj/ios/build/Build/Intermediates/Pods.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/BannerComponent.o /Users/alexvallejo/Sites/myProj/node_modules/react-native-firebase/ios/RNFirebase/admob/BannerComponent.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/alexvallejo/Sites/myProj/ios/build/Build/Intermediates/Pods.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/NativeExpressComponent.o /Users/alexvallejo/Sites/myProj/node_modules/react-native-firebase/ios/RNFirebase/admob/NativeExpressComponent.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
Installing build/Build/Products/Debug-iphonesimulator/myProj.app
An error was encountered processing the command (domain=MIInstallerErrorDomain, code=4):
Failed to chmod /Users/alexvallejo/Library/Developer/CoreSimulator/Devices/31C5C7FC-9DE4-4F95-A7F5-50296C8CC6CB/data/Library/Caches/com.apple.containermanagerd/Bundle/Application/0170A665-460A-4CDF-92B4-0FAC8FBE2224/myProj.app/myProj : No such file or directory
Launching org.reactjs.native.example.myProj
Any ideas on what's going on here? I dont have pod 'Firebase/AdMob' in my Podfile so i don't know why BannerComponent is trying to load.
Make sure you're building with the latest Xcode version. Had the same issue with outdated Xcode.

Carthage fails when trying to install FontAwesomeSwift in iOS project

I am trying to install FontAwesome.Swift in my Xcode project (Swift) so I created a Cartfile with the following line
github "thii/FontAwesome.swift" >= 0.4.1
as described here. Then I ran
carthage update and this happened :
==> carthage update
*** Fetching FontAwesome.swift
*** Checking out FontAwesome.swift at "0.6.0"
*** xcodebuild output can be found in /var/folders/fr/sn4l2f393_v_ytcwkb0lx7_40000gp/T/carthage-xcodebuild.4QnCto.log
*** Building scheme "FontAwesome" in FontAwesome.xcodeproj
** BUILD FAILED **
The following build commands failed:
CompileSwift normal x86_64 <path_to_project>/<ProjectName>/Carthage/Checkouts/FontAwesome.swift/FontAwesome/FontAwesome.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)
<path_to_project>/<ProjectName>/Carthage/Checkouts/FontAwesome.swift/FontAwesome/FontAwesome.swift:72:61: error: 'String.Index' does not have a member named 'advancedBy'
A shell task failed with exit code 65:
** BUILD FAILED **
The following build commands failed:
CompileSwift normal x86_64 <path_to_project>/<ProjectName>/Carthage/Checkouts/FontAwesome.swift/FontAwesome/FontAwesome.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)
I deduce from the error message:
'String.Index' does not have a member named 'advancedBy'
that you are still using Xcode 6.x? The advancedBy API is only available as of Swift 2.0 which ships with Xcode 7.
So, you have two options:
Upgrade your project to Xcode 7 / Swift 2.0
Edit your project's Cartfile so that it fetches a version of FontAwesome.swift that is compatible with you Xcode version. It seems FontAwesome.swift migrated to Swift 2.0 with version 0.6, so specifying a version < 0.6 (instead of >= 0.4.1) might do it.
In case you have both versions of Xcode installed, then Carthage may still use the command line tools from Xcode 6.x instead of the newer ones. You could fix this with the xcodeselect command in Terminal, but it's also possible to switch to the desired version of the tools in the Xcode Preferences (Locations tab).

The location of SharedPrecompileHeaders folders on XCode 6.1.1

I'm building my own SDK and got error about pch
** BUILD FAILED **
The following build commands failed:
ProcessPCH /var/folders/49/qmkbt97910v4p_h0f3c7ygzw0000gr/C/com.apple.DeveloperTools/6.1.1-6A2008a/Xcode/6.1.1-6A2008a/Xcode/SharedPrecompiledHeaders/VoxyPADFramework-Prefix-gfoeppzqeydinfdjwgglsszazzop/VoxyPADFramework-Prefix.pch.pch VoxyPADFramework/VoxyPADFramework-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
ProcessPCH /var/folders/49/qmkbt97910v4p_h0f3c7ygzw0000gr/C/com.apple.DeveloperTools/6.1.1-6A2008a/Xcode/6.1.1-6A2008a/Xcode/SharedPrecompiledHeaders/VoxyPADFramework-Prefix-dqgbxgrxhqfaflffhnvdflncjokz/VoxyPADFramework-Prefix.pch.pch VoxyPADFramework/VoxyPADFramework-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
As guide somewhere I have to remove the SharedPrecompileHeaders on Precompile Header Cache Path, but the path of it is
var/folders/49/qmkbt97910v4p_h0f3c7ygzw0000gr/C/com.apple.DeveloperTools/6.1.1-6A2008a/Xcode/SharedPrecompiledHeaders
I can't find it anywhere on my Mac, how can I manually remove it

Resources