Software Archive
Read-only legacy content
17061 Discussions

How to target more latest iOS version

Arthur_T_
New Contributor I
2,289 Views

I found the latest iOS version available to target is 9.2. Could I change it to 10.2 in case I create a plug-in which require target iOS 10.2 at least ?

P.S. XDK version 3900 on iMac

0 Kudos
40 Replies
PaulF_IntelCorp
Employee
1,364 Views

Use the "Cordova Build Package" export option and modify the config.xml file that is generated by changing this line:

<preference name="deployment-target" value="8.0"/>

Where the "value" will be the target iOS version number you chose in the Build Settings.

Then build with PhoneGap Build or Cordova CLI.

0 Kudos
Arthur_T_
New Contributor I
1,364 Views

I tried on XDK 3900 on my iMac macOS Sierra (v10.12.3) with XCode 8.2.1, after click <Create Package>, nothing happen and seems it just created the config.xml file without prompt me to save the zip

0 Kudos
PaulF_IntelCorp
Employee
1,364 Views

I've seen that once before on my machine. It was caused by a bad or missing intelxdk.config.additions.xml file. I thought that issue had been addressed in the 3900 release.

  • Do you have an intelxdk.config.additions.xml file in your project root?
  • If you do, can you attach it to a post so I can check to see if there is a syntax error in it?

Otherwise, what you can do is use this Node.js script to get a similar result > https://github.com/xmnboy/xdk-to-cli < and please read the docs for additional background on how to use PhoneGap Build or Cordova CLI > https://software.intel.com/en-us/xdk/docs/build-xdk-app-with-phonegap-cordova-cli <

0 Kudos
Arthur_T_
New Contributor I
1,364 Views

Here is the xml

0 Kudos
PaulF_IntelCorp
Employee
1,364 Views

Nothing unusual or a problem in that file. I'll send you a private message for a copy of your project, that might help to understand what is going on.

If you create a project using the "hello cordova" sample does that work correctly? Are you able to export a package with that sample?

0 Kudos
Arthur_T_
New Contributor I
1,364 Views

I found out the reason. It is because the ios.json, fetch.json, android.json, windows.json contain a plug-in that I previously removed (but don't know why it still keep in json) After I remove that plug-in, it prompts to save zip.

Also, as we using CVS to keep our source, so there are CVS folders in plugins folders. However, I found out XDK 3900 will fail in upload file step when build (use the old method, not create package). So I will remove all CVS folders before build. However, when I use create package, it will not prompt me to save the zip even I put old untouch plugins folder named plugins.o together with plugins folder. plugins.o folder can't at project root.

Thanks for your help.

0 Kudos
PaulF_IntelCorp
Employee
1,364 Views

Arthur T. wrote:

I found out the reason. It is because the ios.json, fetch.json, android.json, windows.json contain a plug-in that I previously removed (but don't know why it still keep in json) After I remove that plug-in, it prompts to save zip.

Thanks for that hint. It is normal to see plugins listed in the fetch.json file that are not part of your project.

Arthur T. wrote:

Also, as we using CVS to keep our source, so there are CVS folders in plugins folders. However, I found out XDK 3900 will fail in upload file step when build (use the old method, not create package). So I will remove all CVS folders before build. However, when I use create package, it will not prompt me to save the zip even I put old untouch plugins folder named plugins.o together with plugins folder. plugins.o folder can't at project root.

I would maintain the source code control of your plugins outside of your project. For example, create a source-code folder just for maintaining copies of the plugins (and versions) you are using, and apply your revision controls on those files, not on the ones inside of your projects folder. You can always install a revision controlled plugin into a project from a local file, for example, checkout the specific version you need and add to the project using that checked out plugin.

0 Kudos
Arthur_T_
New Contributor I
1,364 Views

After generate the zip and extracted it to my original xdk project root folder. I follow the guide in how to build by Cordova CLI. However, I found out only config.xml is required and no need the zip because even I cd to the extracted folder from zip and issue 'cordova platform ios', the platform folder is not create in the extracted folder but in my original xdk project root folder and it does the same thing without zip extracted folder (seems platform folder created in config.xml level). Also, I can't generate a signed ipa after issue 'cordova build ios' as it only generate an 'app' extension file in platforms/ios/build/emulator folder.

 

 

0 Kudos
PaulF_IntelCorp
Employee
1,364 Views

Regarding the creation of an IPA when using Cordova CLI, see the second half of this doc > https://software.intel.com/en-us/xdk/docs/build-xdk-app-with-phonegap-cordova-cli < I've updated it to help with that issue (more updates to come). Also, see the links to the official Cordova CLI documentation within that doc, they are your ultimate source of information for using Cordova CLI.

Also, see this post from another developer > https://software.intel.com/en-us/forums/intel-xdk/topic/721783#comment-1901658 <

0 Kudos
Arthur_T_
New Contributor I
1,364 Views

Seems the doc is mainly same as what I saw last time, so with the same problem but with minor different. Here are the details:

- This time it prompt to save zip even I use the plugins folder with CVS folders.

- I save the zip in different location (not in XDK project), extract it, cd to it

- issue commands

cordova platform add ios (this time the platform folder inside zip extracted folder)

with error:

Discovered plugin "com-mooee-localize-app-name" in config.xml. Adding it to the project
Fetching plugin "com-mooee-localize-app-name@1.0.0" via npm
Failed to restore plugin "com-mooee-localize-app-name" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin com-mooee-localize-app-name@1.0.0 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: Registry returned 404 for GET on https://registry.npmjs.org/com-mooee-localize-app-name

As com-mooee-localize-app-name is done by us and it already stated in config.xml: <!-- Locally imported plugins may not work if the plugin is private or modified. -->, so I guess I need to copy this plugin manual to zip extracted folder before build, right?

cordova build ios

as the required plug-in missing, so it output same error during build

Failed to restore plugin "com-mooee-localize-app-name" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin com-mooee-localize-app-name@1.0.0 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: Registry returned 404 for GET on https://registry.npmjs.org/com-mooee-localize-app-name


However at the end, it just generate .app instead of .ipa. What went wrong?

Here are first few lines of build output:

cordova build ios
Discovered plugin "com-mooee-localize-app-name" in config.xml. Adding it to the project
Fetching plugin "com-mooee-localize-app-name@1.0.0" via npm
Failed to restore plugin "com-mooee-localize-app-name" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin com-mooee-localize-app-name@1.0.0 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: Registry returned 404 for GET on https://registry.npmjs.org/com-mooee-localize-app-name
Building project: /Applications/MAMP/htdocs/Projects/PuraPharm/XDKApp/ClinicBooking-pgb-cli-2017-0403-153539/platforms/ios/ClinicBooking.xcworkspace
    Configuration: Debug
    Platform: emulator
Build settings from command line:
    CONFIGURATION_BUILD_DIR = /Applications/MAMP/htdocs/Projects/PuraPharm/XDKApp/ClinicBooking-pgb-cli-2017-0403-153539/platforms/ios/build/emulator
    SDKROOT = iphonesimulator10.3
    SHARED_PRECOMPS_DIR = /Applications/MAMP/htdocs/Projects/PuraPharm/XDKApp/ClinicBooking-pgb-cli-2017-0403-153539/platforms/ios/build/sharedpch

Build settings from configuration file '/Applications/MAMP/htdocs/Projects/PuraPharm/XDKApp/ClinicBooking-pgb-cli-2017-0403-153539/platforms/ios/cordova/build-debug.xcconfig':
    CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
    CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
    CODE_SIGN_IDENTITY = iPhone Developer
    ENABLE_BITCODE = NO
    GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
    HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
    OTHER_LDFLAGS = -ObjC
    SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h

=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===

0 Kudos
PaulF_IntelCorp
Employee
1,364 Views

By default, the "cordova build ios" command builds for the iOS simulator that is provided by Xcode. You have to add "--device" to the command to get it to build an IPA. See the doc page, it includes some additional references regarding the creation of an IPA with Cordova CLI, but with the Xcode 8 release it has resulted in a few hiccups in the process.

Here is the text I was hoping you would find in the updated phonegap export doc page > https://software.intel.com/en-us/xdk/docs/build-xdk-app-with-phonegap-cordova-cli <:

If you encounter issues when building for iOS, especially an "error 65" message, you are probably experiencing app signing issues. This StackOverflow post may be of value. Likewise, employing this hook.js file by Darryl Pogue may be helpful. Finally, this guide to signing iOS apps may be of interest to the very curious.

Additionally, the --debug and --release and --device Cordova CLI options are not well documented, but are essential for creating a "debug" or "release" iOS build and for directing Cordova to build an IPA rather than a simulator image for the Xcode iOS simulator.

0 Kudos
Arthur_T_
New Contributor I
1,364 Views

I can build ios with --device --release now after adding the build.json. However, it fail to build for debug by using cordova build ios --device --debug. It just with errors:

No certificate matching 'iPhone Development' for team 'GRFW6393C6':  Select a different signing certificate for CODE_SIGN_IDENTITY, a team that matches your selected certificate, or switch to automatic provisioning.
Code signing is required for product type 'Application' in SDK 'iOS 10.3'

** ARCHIVE FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Applications/MAMP/htdocs/Projects/PuraPharm/XDKApp/DrugsGuide-pgb-cli-2017-0411-14328/platforms/ios/cordova/build-release.xcconfig,-workspace,DrugsGuide.xcworkspace,-scheme,DrugsGuide,-configuration,Release,-destination,generic/platform=iOS,-archivePath,DrugsGuide.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Applications/MAMP/htdocs/Projects/PuraPharm/XDKApp/DrugsGuide-pgb-cli-2017-0411-14328/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Applications/MAMP/htdocs/Projects/PuraPharm/XDKApp/DrugsGuide-pgb-cli-2017-0411-14328/platforms/ios/build/sharedpch

Also it fail to build

cordova build android --device --release

with errors:

Error: /Applications/MAMP/htdocs/Projects/PuraPharm/XDKApp/DrugsGuide-pgb-cli-2017-0411-14328/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Applications/MAMP/htdocs/Projects/PuraPharm/XDKApp/DrugsGuide-pgb-cli-2017-0411-14328/platforms/android/src/org/crosswalk/engine/XWalkWebViewEngine.java:55: error: XWalkWebViewEngine is not abstract and does not override abstract method evaluateJavascript(String,ValueCallback<String>) in CordovaWebViewEngine
public class XWalkWebViewEngine implements CordovaWebViewEngine {
       ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

0 Kudos
PaulF_IntelCorp
Employee
1,364 Views

Try removing the build.json for the iOS --debug build and see if that works any better.

The Android build problem looks like an issue with the Crosswalk plugin. I recommend changing the Crosswalk version number (perhaps just remove the version number so it uses the latest). If you are only deploying to Android 5 and greater devices you do not need to use Crosswalk at all, it's primary advantage, these days, is for Android 4.x devices.

Alternatively, try using PhoneGap Build, it is generally easier to use than CLI.

FYI -- this Cordova doc page may be useful > https://github.com/apache/cordova-cli/blob/master/doc/readme.md#cordova-build-command <

0 Kudos
Arthur_T_
New Contributor I
1,364 Views

I know PhoneGap Build, but from their web site: http://phonegap.com/blog/2011/10/13/phonegap-build-pricing-plans-update/

Seems it involves cost. However, I don't know whether I can use the free plan or what is private app / private collaborators. As I'm busy in recent days, I haven't try on CLI yet.

P.S.

In order to use the free plan. Does it mean I need to put our project src to github? If I have 3 projects and don't want to upload to github. Does it means we need 3 private apps?

0 Kudos
PaulF_IntelCorp
Employee
1,364 Views

Arthur T. wrote:

I know PhoneGap Build, but from their web site: http://phonegap.com/blog/2011/10/13/phonegap-build-pricing-plans-update/

Seems it involves cost. However, I don't know whether I can use the free plan or what is private app / private collaborators. As I'm busy in recent days, I haven't try on CLI yet.

P.S.

In order to use the free plan. Does it mean I need to put our project src to github? If I have 3 projects and don't want to upload to github. Does it means we need 3 private apps?

The PhoneGap Build free plan includes one "private app slot." Meaning that you can submit the ZIP file we export directly, you do not have to store or submit your app using a public GitHub repo. In fact, you can submit as many apps as you want via that one "private app slot" -- the build system doesn't remember which app you submitted last, so you could submit each of your three apps, sequentially, using a single private slot.

What you cannot do, with a free plan, is use "private plugins." This is a distinct difference between the XDK build system and PGB. In order to build an app that includes "private plugins," on PhoneGap Build, you must have a paid account. Of course, you can do all of this for free if you use Cordova CLI directly, but that requires that you have a Mac to build for iOS and a Windows machine to build for Windows (any machine can be used to build for Android).

0 Kudos
Arthur_T_
New Contributor I
1,364 Views

Thanks for your information on how we can use the "private app slot." However in order to use it, we need to make our private plugin public. But we don't mind on it as that only use for making the app name multi-lingual. Another option is we need to find out how to make Cordova CLI works. (we do have Mac for generate ipa and we don't need Windows build so far, so this is our choice too if it works)

By the way, is it ok for us to use the PGB once we make our private plugin public? If so, is it just simply put it to github?

0 Kudos
PaulF_IntelCorp
Employee
1,364 Views

See this PhoneGap Build doc page for how to reference a plugin. Publish your "private" plugin to a public GitHub (or GitLab, etc.) git repo and provide the git reference in the <plugin> tag stored in the config.xml file. You can do this via the XDK by using the third-party plugin tool to import your git hosted plugin, add it to your project and then export your project using the Cordova Package Build tile. If you inspect the config.xml that is then generated (after you've removed your private plugin reference added your publicly available git-based plugin) you'll see an example of how to reference your plugin via a public git repo. If the XDK is able to import your plugin via a public git repo it means that PhoneGap Build will also be able to import it.

0 Kudos
Arthur_T_
New Contributor I
1,364 Views

Just aware as our plugin used for localize the appname and there is no code at all (i.e. no js api provide). It customize the appname by modifiy Strings.xml/InfoPlist.strings accordingly and adding the corresponding locale folders in locales/android or locales/ios

Is that mean I can't use the PhoneGap Cloud Build free plan as this plugin can't simply make public will work.

0 Kudos
PaulF_IntelCorp
Employee
1,364 Views

Arthur T. wrote:

Just aware as our plugin used for localize the appname and there is no code at all (i.e. no js api provide). It customize the appname by modifiy Strings.xml/InfoPlist.strings accordingly and adding the corresponding locale folders in locales/android or locales/ios

Is that mean I can't use the PhoneGap Cloud Build free plan as this plugin can't simply make public will work.

I don't completely understand your question. Are you asking:

  • Can your plugin be made public and used even though it does not include any JavaScript?
  • Or are you saying that you do not want to publish it in a public repo because it contains some private information?

If the first question, you can still use PhoneGap Build. The only thing a plugin needs is a plugin.xml file. So to make it a "public" plugin you simply need to publish your plugin.xml file into a GitHub or GitLab (or similar) public repo (that you own, it just needs to be addressable using a public URL) and then specify that git repo as the reference for the plugin. Use my previous instructions to see how to test this.

If the second question (concerned about privacy), and you do not want to publish the plugin in a public git repo, you will have to use a private plan with PhoneGap Build. Or, use Cordova CLI and build on your own system.

0 Kudos
Arthur_T_
New Contributor I
1,137 Views

No, my question is our plugin only used to localize the app name and it is simply through the plugin.xml to apply the strings.xml and InfoPlist.strings correspondingly. e.g. in plugin.xml, it may like this

  <!-- android -->
  <platform name="android">
    <resource-file src="locales/android/values-en/strings.xml" target="res/values-en/strings.xml" />
  </platform>

  <!-- ios -->
  <platform name="ios">
    <resource-file src="locales/ios/en.lproj" />
    <resource-file src="locales/ios/zh-hant.lproj" />
  </platform>

In other words, after include the plugin, we still need to edit the strings.xml and InfoPlist.strings to the proper app name and create the corresponding locale folder in our plugin (in case different to original of the plugin). As this customization after include the plugin require, even we make it public, it won't work after build as the final app won't has the correct locale app name.

P.S.

for details of the plugin, I make it public in npmjs.org with id = localize-app-name

0 Kudos
Reply