Phonegap 2.1.0 Cordova/CDVViewController.h file not found - ios

I have installed Xcode 4.5 (no previous phonegap version installed). I have downloaded,extracted and created project by Phonegap tutorial : http://docs.phonegap.com/en/2.1.0/guide_getting-started_ios_index.md.html#Getting%20Started%20with%20iOS
After the terminal command : ./create myproject ~/Desktop/myproject com.test.myproject I have successfly created structure.
Than i launch xcode and wanna Play this example project. Xcode build Fails and says:
Lexical or proccessor issue 'Cordova/CDVViewController.h' file not found
I tried to add this missing header in to classes folder, repaired the import syntax, but still same problem.
Does anybody solved this problem?/HOW?

After many attempts I decided to read Readme.md and solve the problem using ./update_cordova_subproject!
Create project using:
./create ~/Desktop/project com.example.project project
Update cordova subproject reference:
./update_cordova_subproject ~/Desktop/project/project.xcodeproj
Build successfull now!

Related

Unknown folder generated in Derived data

I have a project which was working fine till I was working on my older MacBook. I am now working on new MacBook and the same project gives me build error. My friend also works on the new MacBook with same configuration and os but he is able to build it successfully.
Error on my system is :
<unknown>:0: error: no such file or directory: '/Users/myuser/Library/Developer/Xcode/DerivedData/MyProject-dlhksnilacudcebpmorlzpzlkbid/Build/Intermediates.noindex/MyProject.build/Debug-iphoneos/MyProject.build/DerivedSources/CoreDataGenerated/Model/Model+CoreDataModel.swift'
Command CompileSwiftSources failed with a nonzero exit code
I have navigated to the path
'/Users/myuser/Library/Developer/Xcode/DerivedData/MyProject-dlhksnilacudcebpmorlzpzlkbid/Build/Intermediates.noindex/MyProject.build/Debug-iphoneos/MyProject.build/DerivedSources/CoreDataGenerated/Model'
There I found an unknown folder named "emplate" under which the required file exists.
I have searched the whole project, build settings, build phases, scripts but nowhere I found "emplate".
The CoreData entity Codegen has been specified as "Category/Extension".
Its better if you can install new version xcode or use same version of xcode which your friend is using, i think some path issues with your current xcode
I have got the solution for this. Renamed and Moved Xcode from Desktop to Applications folder, clean the project , removed DerivedData folder. And it works.

Using Swift3 Package Manager with Xcode 8 with no luck

I'm trying to integrate swift package manager in my project, but with no luck. The iOS simulator crashes at startup.
Here are the steps that I followed in order to integrate the package manager:
open xcode and create a new xcodeproject: testcpackage
from the terminal I've run the command:
swift package init to create the Package.swift file
swift package generate-xcodeproj
swift build
swift test - everything seems to be ok
open the new generated file testpackage.xcodeproj in xcode
run the application (cmd+R): build succeeded
first error given by the iOS simulator: Could not attach to pid : “9207”
I close the iOS simulator and I run the project again when I get the 2nd error:
No installable items found at /Users/xxxxxx/Library/Developer/CoreSimulator/Devices/555xxx14-xxx-xx-8E6E-C13D5AB463A0/data/Library/Caches/com.apple.mobile.installd.staging/temp.rA1vGO/extracted/Payload
Could you please help me to solve this issue?
I use the following method to get packages to work in iOS. That being said, I'm not sure if this is the "best" way to do this:
Make starting Package.swift file
swift package generate-xcodeproj
Open project in Xcode
Project : Build Settings : Base SDK ==> change to IOS
Editor : Add Target : (iOS ... Single View App)
Select your project, look at target list, find your newly added target : General : Deployment Info
On toolbar, change "active scheme" to the new target
Run
It has worked for me in the past. However, I have had to fix search paths. I'm currently suffering from that problem here: Xcode: missing required module error
Good luck

‘Cordova/CDV.h’ file not found in Xcode 8.2.1

I have one hybrid Cordova project, which is running fine Xcode 5.1.1, but when I am trying to Archive the project in Xcode 8.2.1 with ‘Generic iOS Device’ I am getting the error ‘Cordova/CDV.h’ is not found.
I read many articles about this problem, but none could solve my problem. Most answers are telling to follow the below steps:
"Add this line to your Build Settings -> Header Search Paths:
$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
"
I have did this but problem not solved, getting another error ‘ld: library not found for -lcrt1.3.1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)’
Also I have changed the bitcode YES to NO in target Build Settings, but no fruitful result.
Project cordova version 3.4.0 where installed cordova version in machine 6.4.0
Has anybody experience with this kind of problem?
Please, can anyone help? I've been working on this for days.
I got it work by following below steps
In your Xcode project settings select TARGETS
Within TARGETS select the Build Settings tab
In the sub-options under the Build Settings tab be sure to select All
Scroll down to the Search Paths section
Locate Header Search Paths
Add the following configuration to the Release option (as a new value on its own line): $(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
Clean the project: Command + Shift + K
Restart Xcode
I wanted to report that the response provided by Vinay worked for me. I had to make sure I was in the share extension target, and I added it to the path exactly as suggested above in the Release option, and did not even have to do a clean to get it to regenerate the PCH.
BUT, I was puzzled by this after looking at the setting further and I realized this path was already in the setting. I edited it again, and removed the redundant path, hit 'run' again, and it loaded onto my iPhone and ran fine.
So, I believe that just setting this in the search path forced a recompile on the share extension PCH and all is working again.
I hope this helps others.
I know its too late to answer on this question but still many developers facing the above issue and as per the latest Cordova & ionic version below steps will work in the above error.
As per new update in Cordova some time due to some permission issue or directly run or build iOS platform it's unable to add below file or folders in your iOS project platform :
CordovaLib
so somehow above folder will not add in your project and that's why it's not building your iOS project.
To overcome this issue you need to remove iOS platform from your ionic project and again add it.
Remove iOS platform: sudo ionic cordova platform remove ios
Add it again: sudo ionic cordova platform add ios
By doing this cordova download CordovaLib folder from server and add it into your iOS project and after that users can able to build their project without any error.
recently I faced this issue and I solved by doing the above steps.
Hope this helps others.
Happy coding!
Seems like the "Cordova" folder isn't getting copied into the project during cordova platform add ios
So, you'll have to copy the "Cordova" source folder into your project manually. But you'll have to download the ios source packages from github first, which is located at:
https://github.com/apache/cordova-ios
After downloading the "cordova-ios-master.zip" package and unzipping it, copy the folder named "CordovaLib" into your project next to the Xcode project file:
PROJECT_FOLDER/platforms/ios/PROJECT_NAME
PROJECT_FOLDER/platforms/ios/PROJECT_NAME.xcodeproj
PROJECT_FOLDER/platforms/ios/PROJECT_NAME.xcworkspace
PROJECT_FOLDER/platforms/ios/cordova
PROJECT_FOLDER/platforms/ios/CordovaLib <------- here
PROJECT_FOLDER/platforms/ios/ios.json
PROJECT_FOLDER/platforms/ios/platform_www
PROJECT_FOLDER/platforms/ios/pods-debug.xcconfig
PROJECT_FOLDER/platforms/ios/pods-release.xcconfig
PROJECT_FOLDER/platforms/ios/www

XCode 8 , Swift 2.3 returns error Could not build module

After I updated to XCode 8 and we are trying to move to Swift 2.3 and I try to compile and build my project but there are few errors. I managed to get every other library working, only PubNub is unable to compile.
I Googled and try different solutions, nothing is working. I can build project from GitHub's test project
https://github.com/pubnub/SwiftExample
Errors are:
pleasurreApp/AppDelegate/AppDelegate.swift:14:8: Could not build Objective-C module 'PubNub'
Pods/PubNub/PubNub/Core/PubNub+CorePrivate.h:1:9: 'PubNub+Core.h' file not found
Please run pod update from your project's root directory (or where Podfile is stored). Current PubNub SDK version is 4.5.3.
Quit Xcode and delete DerivedData folder. After relaunch build should complete well.
Best regards,
Sergey

Installing Phonegap on iOS

Recently I was trying to install Cordova onto my mac so I can compile for the iphone, but I ran into a problem. The option to create a Cordova project wasn't there on xcode. I looked online and saw that I needed to create the project through the terminal. I did this, but nothing was created as far as I can see.
On the terminal, after dragging the bin folder to the terminal I did: ./create /desktop/ios-program/ com.appname appname
Did I do something wrong? Thanks
here a complete guide is given to create phonegap environment in xcode
http://www.adobe.com/devnet/html5/articles/getting-started-with-phonegap-in-xcode-for-ios.html
if it is not enough than go for this
http://www.kendoui.com/blogs/archive/11-12-27/setup_your_phonegap_development_environment_on_mac.aspx
http://docs.phonegap.com/en/2.7.0/guide_getting-started_ios_index.md.html
These instructions are pretty clear, even if the directory tree you get after extracting the zip file is not exactly the one they show.
After installing all the requirements:
1. extract the content of phonegap-2.7.0.zip wherever you want
2. go to lib/ios/bin and run the create command with the suggested parameters.
3. open the finder and go to the directory you used as first parameter
4. doubleclick the file with extension xcodeproj to open XCode and the project will be automatically created
Make sure that you are inside \phonegap-2.7.0\lib\ios\bin before entering ./create command.
Refer the Blog Tutorial

Resources