Re: [PhoneGap] PhoneGap 2.0 Command Line - fatal error: 'Cordova/CDVViewController.h' file not found

5,048 views
Skip to first unread message

Shazron

unread,
Sep 18, 2012, 2:50:54 PM9/18/12
to phon...@googlegroups.com
Run the diagnostics from this issue, read the comments. post the log in a reply:
http://issues.apache.org/jira/browse/CB-1122

There are hints in the Getting Started Guide on some settings you need
to check as well:
http://docs.phonegap.com/en/2.0.0/guide_getting-started_ios_index.md.html#Getting%20Started%20with%20iOS

--------------
"Problems in Xcode

If you have compilation problems related to missing headers, the build
products should build into the same build directory. You may need to
set the preference "Xcode Preferences -> Locations -> Derived Data ->
Advanced…" to "Unique". This is the default setting for Xcode on a
fresh new install, if you upgraded from older versions of Xcode, you
might have a legacy preference in there that you need to update.

Also, when installing Cordova-2.0.0.pkg, you must ensure Xcode is not
running, if not certain Xcode variables won't be set."

--------------

On Tue, Sep 18, 2012 at 9:34 AM, Jakob <jako...@gmail.com> wrote:
> Hi,
>
> 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 4.4.1
> PhoneGap 2.0
>
> I´m working on a fresh MacBook Air so everything is clean installed and
> nothing upgraded.
>
> --
> -- You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
>
> To compile in the cloud, check out build.phonegap.com
>
>

Jakob

unread,
Sep 19, 2012, 3:47:41 AM9/19/12
to phon...@googlegroups.com
Thanks so much for the fast answer. As I mentioned above I´ve no issues with building the Project with Xcode, just from the command line I get this error. 

My Log:

-------------------------------------BEGIN--------------------------------------
Inspecting project: /Users/jakob/Dropbox/Coding/phonegap/ios_project/ios_project.xcodeproj/project.pbxproj


--------------------------------------------------------------------------------
Finding your project's sub-projects...

Sub-project: {'path': 'CordovaLib.xcodeproj', 'name': '(not found)', 'sourceTree': 'CORDOVALIB'}


--------------------------------------------------------------------------------
Inspecting your project's Build Settings...

Debug :
{   'ARCHS': '$(ARCHS_STANDARD_32_BIT)',
    'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
    'HEADER_SEARCH_PATHS': [   '"$(TARGET_BUILD_DIR)/usr/local/lib/include"',
                               '"$(OBJROOT)/UninstalledProducts/include"',
                               '"$(BUILT_PRODUCTS_DIR)"'],
    'IPHONEOS_DEPLOYMENT_TARGET': '4.2',
    'OTHER_LDFLAGS': [   '-weak_framework',
                         'CoreFoundation',
                         '-weak_framework',
                         'UIKit',
                         '-weak_framework',
                         'AVFoundation',
                         '-weak_framework',
                         'CoreMedia',
                         '-weak-lSystem',
                         '-all_load',
                         '-Obj-C'],
    'USER_HEADER_SEARCH_PATHS': ''}
Release :
{   'ARCHS': '$(ARCHS_STANDARD_32_BIT)',
    'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
    'HEADER_SEARCH_PATHS': [   '"$(TARGET_BUILD_DIR)/usr/local/lib/include"',
                               '"$(OBJROOT)/UninstalledProducts/include"',
                               '"$(BUILT_PRODUCTS_DIR)"'],
    'IPHONEOS_DEPLOYMENT_TARGET': '4.2',
    'OTHER_LDFLAGS': [   '-weak_framework',
                         'CoreFoundation',
                         '-weak_framework',
                         'UIKit',
                         '-weak_framework',
                         'AVFoundation',
                         '-weak_framework',
                         'CoreMedia',
                         '-weak-lSystem',
                         '-all_load',
                         '-Obj-C'],
    'USER_HEADER_SEARCH_PATHS': ''}


--------------------------------------------------------------------------------
Inspecting Xcode Preferences...

CORDOVALIB: /Users/jakob/Documents/CordovaLib
Build Location Style: Unique


--------------------------------------------------------------------------------
Inspecting your CordovaLib's Build Settings...

Your project is using the CORDOVALIB Xcode variable (source tree).
Path is: /Users/jakob/Documents/CordovaLib/CordovaLib.xcodeproj 

{   'Debug': {   'ARCHS': ['armv6', 'armv7'],
                 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                 'IPHONEOS_DEPLOYMENT_TARGET': '3.0',
                 'OTHER_LDFLAGS': ['-all_load', '-ObjC'],
                 'PUBLIC_HEADERS_FOLDER_PATH': 'include/Cordova',
                 'USER_HEADER_SEARCH_PATHS': ''},
    'Release': {   'ARCHS': ['armv6', 'armv7'],
                   'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                   'IPHONEOS_DEPLOYMENT_TARGET': '3.0',
                   'OTHER_LDFLAGS': ['-all_load', '-ObjC'],
                   'PUBLIC_HEADERS_FOLDER_PATH': 'include/Cordova',
                   'USER_HEADER_SEARCH_PATHS': '(not found)'}}


--------------------------------------------------------------------------------
Inspecting CordovaLib Version...

VERSION file: 2.0.0
CDVAvailability.h version:  __CORDOVA_2_0_0 

--------------------------------------END---------------------------------------

thank you!

Jakob

unread,
Sep 19, 2012, 10:20:15 AM9/19/12
to phon...@googlegroups.com
Today I installed PhoneGap also on my Mac Mini with exact the same configs (reseted both last week) 
Here everything works fine :/

except I got this error warning aber building: 

....
....
** BUILD SUCCEEDED **
....
....
jakob@mini:~
$ /Users/jakob/Dropbox/Coding/phonegap/testme/cordova/emulate
-e Error: ios-sim was not found. Please download, build and install version 1.4 or greater from https://github.com/phonegap/ios-sim into your path. Or "brew install ios-sim" using homebrew: http://mxcl.github.com/homebrew/

jakob@mini:~
$ brew install ios-sim                                       ==> Downloading https://github.com/phonegap/ios-sim/tarball/1.5.1
######################################################################## 100,0%
==> rake install prefix=/usr/local/Cellar/ios-sim/1.5.1
Warning: Could not fix install names for /usr/local/Cellar/ios-sim/1.5.1/bin/ios-sim
/usr/local/Cellar/ios-sim/1.5.1: 4 files, 88K, built in 10 seconds

I don´t know why homebrew failed with the installation but anyway since I startet the Simulator once via Xcode everything works now from command line. 

But I´m still confused why it´s not running on my MacBook -.- 

all the best,
Jakob

Shazron

unread,
Sep 19, 2012, 3:00:51 PM9/19/12
to phon...@googlegroups.com
Thanks, can you run this updated script? The previous one did not show
Target settings:
https://raw.github.com/apache/incubator-cordova-ios/f187cdd742ae179263192abad231f26d153e9be8/bin/diagnose_project

Jakob

unread,
Sep 20, 2012, 3:26:09 AM9/20/12
to phon...@googlegroups.com
The output of the script is:
-------------------------------------BEGIN--------------------------------------
Inspecting project: /Users/jakob/Dropbox/Coding/phonegap/hello_world/hello_world.xcodeproj/project.pbxproj


--------------------------------------------------------------------------------
Finding your project's sub-projects...

Sub-project: {'path': 'CordovaLib.xcodeproj', 'name': '(not found)', 'sourceTree': 'CORDOVALIB'}


--------------------------------------------------------------------------------
Inspecting your project's Build Settings...

Project :
{   'Debug': {   'ARCHS': '$(ARCHS_STANDARD_32_BIT)',
                 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                 'HEADER_SEARCH_PATHS': [   '"$(TARGET_BUILD_DIR)/usr/local/lib/include"',
                                            '"$(OBJROOT)/UninstalledProducts/include"',
                                            '"$(BUILT_PRODUCTS_DIR)"'],
                 'IPHONEOS_DEPLOYMENT_TARGET': '4.2',
                 'OTHER_LDFLAGS': [   '-weak_framework',
                                      'CoreFoundation',
                                      '-weak_framework',
                                      'UIKit',
                                      '-weak_framework',
                                      'AVFoundation',
                                      '-weak_framework',
                                      'CoreMedia',
                                      '-weak-lSystem',
                                      '-all_load',
                                      '-Obj-C'],
                 'USER_HEADER_SEARCH_PATHS': ''},
    'Release': {   'ARCHS': '$(ARCHS_STANDARD_32_BIT)',
                   'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                   'HEADER_SEARCH_PATHS': [   '"$(TARGET_BUILD_DIR)/usr/local/lib/include"',
                                              '"$(OBJROOT)/UninstalledProducts/include"',
                                              '"$(BUILT_PRODUCTS_DIR)"'],
                   'IPHONEOS_DEPLOYMENT_TARGET': '4.2',
                   'OTHER_LDFLAGS': [   '-weak_framework',
                                        'CoreFoundation',
                                        '-weak_framework',
                                        'UIKit',
                                        '-weak_framework',
                                        'AVFoundation',
                                        '-weak_framework',
                                        'CoreMedia',
                                        '-weak-lSystem',
                                        '-all_load',
                                        '-Obj-C'],
                   'USER_HEADER_SEARCH_PATHS': ''}}
Targets :
{   'hello_world': {   'Debug': {   'ARCHS': '(not found)',
                                    'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                                    'HEADER_SEARCH_PATHS': '(not found)',
                                    'IPHONEOS_DEPLOYMENT_TARGET': '4.2',
                                    'OTHER_LDFLAGS': '(not found)',
                                    'USER_HEADER_SEARCH_PATHS': '(not found)'},
                       'Release': {   'ARCHS': '(not found)',
                                      'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                                      'HEADER_SEARCH_PATHS': '(not found)',
                                      'IPHONEOS_DEPLOYMENT_TARGET': '4.2',
                                      'OTHER_LDFLAGS': '(not found)',
                                      'USER_HEADER_SEARCH_PATHS': '(not found)'}}}


--------------------------------------------------------------------------------
Inspecting Xcode Preferences...

CORDOVALIB: /Users/jakob/Documents/CordovaLib
Build Location Style: Unique


--------------------------------------------------------------------------------
Inspecting your CordovaLib's Build Settings...

Your project *IS* using the CORDOVALIB Xcode variable (source tree).
Path is: /Users/jakob/Documents/CordovaLib/CordovaLib.xcodeproj 

{   'Project': {   'Debug': {   'ARCHS': ['armv6', 'armv7'],
                                'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                                'IPHONEOS_DEPLOYMENT_TARGET': '3.0',
                                'OTHER_LDFLAGS': ['-all_load', '-ObjC'],
                                'PUBLIC_HEADERS_FOLDER_PATH': 'include/Cordova',
                                'USER_HEADER_SEARCH_PATHS': ''},
                   'Release': {   'ARCHS': ['armv6', 'armv7'],
                                  'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                                  'IPHONEOS_DEPLOYMENT_TARGET': '3.0',
                                  'OTHER_LDFLAGS': ['-all_load', '-ObjC'],
                                  'PUBLIC_HEADERS_FOLDER_PATH': 'include/Cordova',
                                  'USER_HEADER_SEARCH_PATHS': '(not found)'}},
    'Targets': {   'CordovaLib': {   'Debug': {   'ARCHS': [   'armv6',
                                                               'armv7'],
                                                  'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                                                  'IPHONEOS_DEPLOYMENT_TARGET': '3.0',
                                                  'OTHER_LDFLAGS': '(not found)',
                                                  'PUBLIC_HEADERS_FOLDER_PATH': 'include/Cordova',
                                                  'USER_HEADER_SEARCH_PATHS': '(not found)'},
                                     'Release': {   'ARCHS': [   'armv6',
                                                                 'armv7'],
                                                    'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                                                    'IPHONEOS_DEPLOYMENT_TARGET': '3.0',
                                                    'OTHER_LDFLAGS': '(not found)',
                                                    'PUBLIC_HEADERS_FOLDER_PATH': 'include/Cordova',
                                                    'USER_HEADER_SEARCH_PATHS': '(not found)'}},
                   'CordovaLibApp': {   'Debug': {   'ARCHS': [   'armv6',
                                                                  'armv7'],
                                                     'GCC_VERSION': '(not found)',
                                                     'IPHONEOS_DEPLOYMENT_TARGET': '5.1',
                                                     'OTHER_LDFLAGS': '(not found)',
                                                     'PUBLIC_HEADERS_FOLDER_PATH': '(not found)',
                                                     'USER_HEADER_SEARCH_PATHS': '(not found)'},
                                        'Release': {   'ARCHS': [   'armv6',
                                                                    'armv7'],
                                                       'GCC_VERSION': '(not found)',
                                                       'IPHONEOS_DEPLOYMENT_TARGET': '5.1',
                                                       'OTHER_LDFLAGS': '(not found)',
                                                       'PUBLIC_HEADERS_FOLDER_PATH': '(not found)',
                                                       'USER_HEADER_SEARCH_PATHS': '(not found)'}},
                   'CordovaLibTests': {   'Debug': {   'ARCHS': [   'armv6',
                                                                    'armv7'],
                                                       'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                                                       'IPHONEOS_DEPLOYMENT_TARGET': '3.0',
                                                       'OTHER_LDFLAGS': [   '-all_load',
                                                                            '-ObjC',
                                                                            '-framework',
                                                                            'SenTestingKit'],
                                                       'PUBLIC_HEADERS_FOLDER_PATH': '(not found)',
                                                       'USER_HEADER_SEARCH_PATHS': '(not found)'},
                                          'Release': {   'ARCHS': [   'armv6',
                                                                      'armv7'],
                                                         'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
                                                         'IPHONEOS_DEPLOYMENT_TARGET': '3.0',
                                                         'OTHER_LDFLAGS': [   '-all_load',
                                                                              '-ObjC',
                                                                              '-framework',
                                                                              'SenTestingKit'],
                                                         'PUBLIC_HEADERS_FOLDER_PATH': '(not found)',
                                                         'USER_HEADER_SEARCH_PATHS': '(not found)'}}}}


--------------------------------------------------------------------------------
Inspecting CordovaLib Version...

VERSION file: 2.0.0
CDVAvailability.h version:  __CORDOVA_2_0_0 

--------------------------------------END---------------------------------------

When I generate a project on my Mac Mini I can build(debug and emulate) it with the Mac Book Air. When I generate one with my Mac Book Air it won´t work. 
This is the output of the Mac Book Air of course. 

Thank you so much for the help!

santhosh reddy

unread,
Sep 6, 2013, 6:40:52 AM9/6/13
to phon...@googlegroups.com
Hi Carlos Santana,

Thanks a ton. It worked like a magic. Saved my day :-) 

On Wednesday, September 19, 2012 9:52:48 PM UTC+5:30, Carlos Santana wrote:
I was able to fix this problem by updating my build script.
I added to my .app creation command line the following CONFIGURATION_BUILD_DIR=${myApp.ios.out.release}/build
Where ${myApp.ios.out.release} is the xcode main project folder where myApp.xcode is located.
What will this do is force main project and subproject (i.e CordovaLib) to build in the same location.
The variable CONFIGURATION_BUILD_DIR will be use by both projects build settings.


Here is the example of the command I use to build .app and ipa ( I have a modify project because I moved the CordovaLib subproject inside the main project)
xcodebuild" -sdk iphoneos" -verbose -project myApp.xcodeproj -target myApp-configuration ReleaseCONFIGURATION_BUILD_DIR=${myApp.ios.out.release}/build 'CODE_SIGN_IDENTITY="iPhone Developer"' build
xcrun" -sdk iphoneos PackageApplication ${myApp.ios.out.release}/build/MSM.app -o ${myApp.ios.out.release.ipa} -verbose
I hope this helps

Carlos Santana

unread,
Sep 6, 2013, 7:41:19 AM9/6/13
to phon...@googlegroups.com
Wow! a year later from that post. 
 I'm glad this was helpful 


- Carlos
Sent from my iPhone
Encoded as Geek
---
You received this message because you are subscribed to a topic in the Google Groups "phonegap" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phonegap/X_S13Y_j79o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages