Creating iPhone app using phonegap on Windows7 - ios

C:\soft\my-app>phonegap create something
[phonegap] create called with the options C:\soft\my-app\something com.phonegap.helloworld HelloWorld
[phonegap] Customizing default config.xml file
[phonegap] created project at C:\soft\my-app\something
cd something
C:\soft\my-app\something>phonegap build ios
[phonegap] detecting iOS SDK environment...
[phonegap] using the local environment
[phonegap] adding the iOS platform...
{ [CordovaError: Applications for platform ios can not be built on this OS - win32.]
name: 'CordovaError',
message: 'Applications for platform ios can not be built on this OS - win32.' }
[error] Applications for platform ios can not be built on this OS - win32.
[phonegap] using the remote environment
{ [Error: ENOENT, open 'C:\soft\my-app\something\www\config.xml']
errno: 34,
code: 'ENOENT',
path: 'C:\\soft\\my-app\\something\\www\\config.xml' }
[error] ENOENT, open 'C:\soft\my-app\something\www\config.xml'
When I look at windows information (Right click on my computer) it shows windows OS as 64 bit.
What could be causing this issue ? I am trying to develop iphone app on windows 7. I installed node.js and phonegap using following command: npm install -g phonegap
Do I need to install cordova ?

What Scott Hunter said isn't entirely true, you can build IOS using windows.
It will use phonegap build to compile the code as is shown by this line "[phonegap] using the remote environment"
I am having the same issue as OP though, I'm thinking its a bug. As I haven't had issues in the past and just recently upgraded and tried to create a new project.
Edit: Downgrading to an older version should work, its looking like:
npm -g install phonegap#3.5.0-0.21.18

You can't build an iOS app on anything other than Mac OSX.

Related

Unable to run fresh kotlin multiplatform app on ios

Doing a fresh install of a kotlin multiplatform app I am unable to get the ios app to run. Android works just fine. My issue is Android Studio is unable to find xcode project schemes.
Following the tutorial from kotlin lang website get started it seems like it should just be able to run: https://kotlinlang.org/docs/mobile/create-first-app.html#run-on-a-different-iphone-simulated-device.
Here are my versions:
Android Studio: 4.1.1
Xcode: 12.2 (12B45b)
EDIT 1:
Here is the error mentioned in the configuration page of android studio:
Please check specified Xcode project file: can't grab Xcode schemes with /usr/bin/xcodebuild -project /Users/ommitedforbrevity/./iosApp/iosApp.xcodeproj -list
EDIT 2:
Log also shows several errors like this: TextMate bundle load error: Bundle mdx can't be registered
I confirmed that the bundled plugin TextMate Bundles is included and enabled.

"cordova run ios " in Windows not works

I install "ionic cordova run ios" on my PC (Windows 10) but I got an error message
"[ERROR] An error occurred while running subprocess cordova."
Does anyone know how to fix this?
To build an app for iOS you need to have the xcode command line tools installed. Cordova looks for these tools before building. If you don't have that, you can't build your app for iOS.
If you want to build your app for iOS you'll need a Mac with xcode and Cordova installed. Or you could use a virtual machine to do it. For more information on the virtual machine option have look here

Ionic building an IOS application

I have finished building and compiling the Android version of the application from my windows laptop.
But to run it on IOS, am I supposed to copy the application folder to a MAC computer and run "ionic run ios"?
Follow these steps.
Check whether Ionic is already installed in Mac by typing ionic -v.
If Ionic is already installed, type the following commands:
ionic platform add ios.
ionic build ios.
If Ionic is not installed yet,
First install Node.js in Mac.
Then install Cordova and Ionic by using this command:
npm install -g cordova ionic
Once done with the installation, use the above commands for adding platform and build.
Then you will able to see Xcode file in platform folder iOS.
Then you can ask iOS developer to generate ipa file for iOS build.
You should add ionic ios platform before build
ionic platform add ios
Read this link : Ionic build

Unable to compile Phonegap app locally

I'm unable to compile my app for iOS locally, Android works OK.
I have installed both cordova and phonegap using npm install -g [...]. I am running OSX (10.7.5).
Version outputs from both:
$ cordova -v
5.1.1
$ phonegap -v
0.9.4
I have XCode installed (v 4.6.2). I also have the command-line tools installed.
Both the cordova and phonegap tools fail to build, seemingly for the same reason. Running phonegap build ios outputs:
$ phonegap build ios
phonegap detecting iOS SDK environment...
phonegap using the local environment
phonegap compiling iOS...
error ENOENT, no such file or directory '/Users/mike/apps/***/platforms/ios/__CLI__/config.xml'
Here is the output from the same cordova command:
$ cordova build ios
cp: copyFileSync: could not write to dest file (code=ENOENT):/Users/mike/apps/***/platforms/ios/__CLI__/config.xml
cp: no such file or directory: /Users/mike/apps/***/platforms/ios/platform_www/*
Parsing /Users/mike/apps/***/platforms/ios/__CLI__/config.xml failed
Error: ENOENT, no such file or directory '/Users/mike/apps/***/platforms/ios/__CLI__/config.xml'
at Error (native)
at Object.fs.openSync (fs.js:500:18)
at Object.fs.readFileSync (fs.js:352:15)
at Object.module.exports.parseElementtreeSync (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/util/xml-helpers.js:118:27)
at Object.ConfigParser (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/configparser/ConfigParser.js:33:24)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:115:32
at Array.map (native)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:70:40
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
It seems to me that there should be some replacement running on __CLI__ in the path that isn't happening, but it's difficult to tell. Below is a screenshot of the file structure this generates:
I am able to build using the remote build service, but it's quite laborious, as the app isn't properly loading so I need to do quite a bit of debugging to sort this out.
Node is installed at version 0.12.5. NPM is installed at version 2.11.2.
I have reinstalled the platform numerous times, and always get this error.
This question is a little old, but I'll throw a few things out there:
I've got a command line build of my ios platform running -- it does not have an __CLI__... subdirectory. Just a data point.
I'm wondering if there isn't something weird with the way Xcode is set up in relation to its build path. See this answer to make sure the output directory is set correctly: still getting <Cordova/CDVViewController.h> file not found error in xcode. I've got a desktop and mobile app set up in Xcode, and I have to remember to switch this setting back and forth.
PhoneGap / Cordova have been phasing out older versions of ios with their newer releases. It would not surprise me if cordova 5.1.1 did not support Xcode 4.6.2. You might want to try with an older release of the cordova library.

PhoneGap CLI "cordova build ios" failed

i have created a new hello world project using the following command,
cordova create hello com.example.hello HelloWorld
the project is created successfully, then i add the ios platform by
cordova platform add ios
and to verify i have it added correctly, i type
cordova platform list
the iOS platform is shown in the list. so at this point, according to the PhoneGap tutorial, i can use the command
cordova build ios
to build the iOS version of the project. however, i encounter the following error:
Generating config.xml from defaults for platform "ios"
Preparing ios project
Compiling app on platform "ios" via command "/Users/Aldour/PhoneGap/hello/platforms/ios/cordova/build"
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while building the ios project.
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/compile.js:65:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
the results that i have googled are mostly concerning the android version, talking about the invalid environment path setting. i dont know if it is related since i can create and build a PhoneGap project targeting the android platform without problem.
here is my $PATH:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin/node:/usr/local/bin/npm:/Developer/SDKs/android-sdk-macosx/platform-tools:/Developer/SDKs/android-sdk-macosx/tools
EDIT:
problem solved by re-installing xcode from app store
I had the same problem in Android platform, and it was solved with the commands:
cordova platform rm android
cordova platform add android
cordova build android
in Node.Js console. try it in ios.
If you get an error with 'cordova platform add android', you may need to manually remove any android folders in your project folder hierarchy.
This resolved my issue:
cordova platform remove ios
cordova platform add ios
cordova build ios
If you run the build with --verbose, you will probably see some permission issues. By default, XCode creates a folder of the build in ~/Developer, if you haven't changed it. There probably is a permissions issue when creating that folder. Just execute the following command: sudo cordova bulid ios
That should fix your issue.

Resources