Notes for upgrading to cli-5.1.1 on PGB

  • 1
  • Announcement
  • Updated 5 years ago
1. There are a ton of changes in the update, especially with Android 4.0.2. Make sure you read the release notes for each platform you are using -- they are linked from the blog post.

2. If you're utilizing a whitelist to access remote resources, you now need to use the whitelist plugin:
<gap:plugin name="cordova-plugin-whitelist" source="npm" />

3. You now need to source your core plugins from npm (see above whitelist plugin for example). We no longer update the core plugins on PGB.

Issues (workin on em)
- Hydration + Android cli-5.1.1 build fails fixed
- Using a signing key w/ Android cli-5.1.1 build fails fixed

Add more below as you find it!
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes

Posted 5 years ago

  • 1
Photo of Alan Neveu

Alan Neveu, Champion

  • 213 Posts
  • 11 Reply Likes
Can someone describe or post a link on how to use crosswalk with PhonrGap Build? We need to control usage (or non-usage) of Android System WebView.
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
Are you looking to dymanically set which engine is used? Including the plugin in your app replaces the system webview with the crosswalk webview. There's not much else to it wrt PhoneGap Build. If you're looking for more in-depth configuration, you probably want to track down a crosswalk-specific forum.
Photo of Alan Neveu

Alan Neveu, Champion

  • 213 Posts
  • 11 Reply Likes
That's exactly what I'm looking for. I'll give it a shot with PG 5.1.1 and see if I can get it to work. I can easily test because we have several Nexus 5 and 7 devices that exhibit serious problems of Android System WebView is updated to the June update (version 43 I believe). It is easy to update it and then uninstall updates of that component of Android. This issue has plagued PhoneGap developers recently so I will post my lessons learned for others to enjoy. Thanks!
Photo of Alan Neveu

Alan Neveu, Champion

  • 213 Posts
  • 11 Reply Likes
Okay, I think I have crosswalk working in place of the Android System Webview. But crosswalk webview keeps locking up after just 10 seconds of using my app. I'll check some forums...
Photo of Ashwin Bhayal

Ashwin Bhayal

  • 17 Posts
  • 2 Reply Likes
Hi All,

I have resolved problem
Please use below code in config.xml file

gap:plugin name="org.apache.cordova.battery-status" source="npm" />
gap:plugin name="org.apache.cordova.camera" source="npm" />
gap:plugin name="org.apache.cordova.media-capture" source="npm" />
gap:plugin name="org.apache.cordova.console" source="npm" />
gap:plugin name="org.apache.cordova.contacts" source="npm"/>
gap:plugin name="org.apache.cordova.device" source="npm"/>
gap:plugin name="org.apache.cordova.device-motion" source="npm"/>
gap:plugin name="org.apache.cordova.device-orientation" source="npm"/>
gap:plugin name="org.apache.cordova.dialogs" source="npm"/>
gap:plugin name="org.apache.cordova.file" source="npm" />
gap:plugin name="org.apache.cordova.file-transfer" source="npm"/>
gap:plugin name="org.apache.cordova.geolocation" source="npm"/>
gap:plugin name="org.apache.cordova.globalization" source="npm"/>
gap:plugin name="org.apache.cordova.inappbrowser" source="npm"/>
gap:plugin name="org.apache.cordova.media" source="npm" />
gap:plugin name="org.apache.cordova.network-information" source="npm" />
gap:plugin name="org.apache.cordova.splashscreen" source="npm"/>
gap:plugin name="org.apache.cordova.vibration" source="npm" />

(i have removed the < at the start so they display here) third party plugins like Google connect dont need it.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
These are all the wrong names for the plugins. Currently, PGB might translate them to their real name, but there's no guarantee that that will work forever. Better use the plugin's name as published at NPM.
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
Couple known issues that have cropped up that we're working on:
- Hydration + Android cli-5.1.1 build fails
- Using a signing key w/ Android cli-5.1.1 build fails
Photo of Alan Neveu

Alan Neveu, Champion

  • 213 Posts
  • 11 Reply Likes
Do you have an ETA on the issue with using a signing key w/ Android cli-5.1.1 build fails?
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
No ... but will make it a priority.
Photo of Alan Neveu

Alan Neveu, Champion

  • 213 Posts
  • 11 Reply Likes
Thanks buddy, really appreciate!
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
OK signed Android builds are fixed!
Photo of Alan Neveu

Alan Neveu, Champion

  • 213 Posts
  • 11 Reply Likes
Confirmed!
Photo of ernst

ernst

  • 6 Posts
  • 0 Reply Likes
Since this upgrade the device menubutton fails to show my menu.
I have this feature in the config:

My script:
function onDeviceReady() {
document.addEventListener('menubutton', onMenuKeyDown, false);
document.addEventListener('searchbutton', onSearchKeyDown, false);
}

/**
* Detects if instance runs in PhoneGap or just in a browser
* @return {boolean}
*/
function isPhoneGap() {
var app = document.URL.indexOf('http://') === -1 && document.URL.indexOf('https://') === -1; // && document.URL.indexOf( 'file://' );
if (app) {
return true;
}
return false;
}

if (isPhoneGap()) {
// Call onDeviceReady when PhoneGap is loaded.
//
// At this point, the document has loaded but phonegap.js has not.
// When PhoneGap is loaded and talking with the native device, it will call the event `deviceready`.
document.addEventListener('deviceready', onDeviceReady, false);
}

Any idea's?
Photo of ernst

ernst

  • 6 Posts
  • 0 Reply Likes
Config.xml part has been stripped out:

(feature name="http://api.phonegap.com/1.0/device" /)
(preference name='phonegap-version' value='cli-5.1.1' /)
(preference name="permissions" value="none"/)
(gap:plugin name="Device" value="org.apache.cordova.core.Device" source="npm" /)
(gap:plugin name="cordova-plugin-splashscreen" source="npm" /)
(gap:plugin name="cordova-plugin-inappbrowser" source="npm" /)
(gap:plugin name="cordova-plugin-whitelist" source="npm" /)

This is with braces.
Any idea's?
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
hi ryan
there is a whitelist problem under here
http://community.phonegap.com/nitobi/...
Photo of ernst

ernst

  • 6 Posts
  • 0 Reply Likes
Android:

deviceready event fires.. but the menubutton event (set with document.addEventListener('menubutton', onMenuKeyDown, false);) doesn't fire.

This worked with PGB version 3.7.0, in cli-5.1.1 this is broken.

What can I do to solve this issue?
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
hi all
I also have the same trouble just like ernst said
not only 'menubutton' but also 'backbutton' also fail after upgrading to cli-5.1.1
Photo of Yi Ming Kuan

Yi Ming Kuan

  • 1840 Posts
  • 78 Reply Likes
If anyone is having iOS build issues, set your whitelist plugin to use v1.0.0 for the time being, until we add support for v4.0.0 of the iOS platform release:

<gap:plugin name="cordova-plugin-whitelist" source="npm" version="1.0.0" />

Also, if you have compile errors for Android after adding the Whitelist plugin, upgrade all first-party Cordova plugins used in your app to use their npm sources:

<gap:plugin name="cordova-plugin-file" source="npm" />
<gap:plugin name="cordova-plugin-file-transfer" source="npm" />
<gap:plugin name="cordova-plugin-inappbrowser" source="npm" />

-yiming
(Edited)
Photo of ernst

ernst

  • 6 Posts
  • 0 Reply Likes
Hi Yi Ming Kuan,

Thanks. Setting a version is a good idea :-)
Do you recognize the problem with the failing menubutton?

Phonegap.js is included on both html source and as file, and the deviceready event fires.
However, the alert I put in the onMenbuKeyDown() function doesn't show up.

Regards,
Ernst
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
You shouldn't include a phonegap.js file.
Photo of ernst

ernst

  • 6 Posts
  • 0 Reply Likes
Hi Petra,

Thanks for your answer. I don't include this file manually, but when I check the apk, this file is included correctly by PGB.

Regards,
Ernst
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
Hi,Petra,just like Ernst said,you can use 5.1.1 version and test the menu button or back button function in android that you will know what we said
Photo of Yi Ming Kuan

Yi Ming Kuan

  • 1840 Posts
  • 78 Reply Likes
The menu button issue is Cordova related and not PGB. Issue filed here: https://issues.apache.org/jira/browse/CB-8921

-yiming
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
hi Yiming
thanks for your reply
so...
how about my case => "backbutton"
I also try in Cordova Cli 5.1.1,it's work
but phonegap cli 5.1.1 (build.phonegap.com) not work
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
my fault
it's the "cache" problem to cause the "backbutton" not work
sorry
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
no any reply or ??? ...
Photo of ernst

ernst

  • 6 Posts
  • 0 Reply Likes
I'll wait for the next version, hope they take this issue serious.
Photo of Cenon Dinno Ebora

Cenon Dinno Ebora

  • 1 Post
  • 0 Reply Likes
have we fix the "Hydration + Android cli-5.1.1" ?
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
yes
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Ryan,
can you please update the original post to reflect that "Hydration + Android cli-5.1.1" is fixed. This particular post use for an FAQ list the developers on the Google Group is developing.
This will likely go out on Monday (Aug 17, 2015)
Top Mistakes by Developers new to Cordova/Phonegap
TIA
Jesse
Photo of Ashwin Bhayal

Ashwin Bhayal

  • 17 Posts
  • 2 Reply Likes
Hi All,

I have resolved problem
Please use below code in config.xml file

gap:plugin name="org.apache.cordova.battery-status" source="npm" />
gap:plugin name="org.apache.cordova.camera" source="npm" />
gap:plugin name="org.apache.cordova.media-capture" source="npm" />
gap:plugin name="org.apache.cordova.console" source="npm" />
gap:plugin name="org.apache.cordova.contacts" source="npm"/>
gap:plugin name="org.apache.cordova.device" source="npm"/>
gap:plugin name="org.apache.cordova.device-motion" source="npm"/>
gap:plugin name="org.apache.cordova.device-orientation" source="npm"/>
gap:plugin name="org.apache.cordova.dialogs" source="npm"/>
gap:plugin name="org.apache.cordova.file" source="npm" />
gap:plugin name="org.apache.cordova.file-transfer" source="npm"/>
gap:plugin name="org.apache.cordova.geolocation" source="npm"/>
gap:plugin name="org.apache.cordova.globalization" source="npm"/>
gap:plugin name="org.apache.cordova.inappbrowser" source="npm"/>
gap:plugin name="org.apache.cordova.media" source="npm" />
gap:plugin name="org.apache.cordova.network-information" source="npm" />
gap:plugin name="org.apache.cordova.splashscreen" source="npm"/>
gap:plugin name="org.apache.cordova.vibration" source="npm" />

(i have removed the < at the start so they display here) third party plugins like Google connect dont need it.
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
your way is not correct
please use "cordova-plugin-*"
Photo of Marcos Henrique

Marcos Henrique

  • 5 Posts
  • 0 Reply Likes
Anyone of my plugins works, I changed the config.xml, but after building the app, he still doesn ́t works:
my config.xml:
Photo of Marcos Henrique

Marcos Henrique

  • 5 Posts
  • 0 Reply Likes
preference name="permissions" value="none"
preference name="phonegap-version" value="cli-5.2.0"/>
preference name="orientation" value="portrait" />
preference name="target-device" value="universal" />
reference name="fullscreen" value="true" />
preference name="webviewbounce" value="true" />
preference name="prerendered-icon" value="true" />
preference name="stay-in-webview" value="false" />
preference name="ios-statusbarstyle" value="black-opaque" />
preference name="detect-data-types" value="true" />
preference name="exit-on-suspend" value="false" />
preference name="show-splash-screen-spinner" value="true" />
preference name="auto-hide-splash-screen" value="true" />
preference name="disable-cursor" value="false" />
preference name="android-minSdkVersion" value="10" />
preference name="android-installLocation" value="auto" />

gap:plugin name="com.phonegap.plugins.barcodescanner"/>
gap:plugin name="cordova-plugin-battery-status" source="npm" />
gap:plugin name="cordova-plugin-dialogs" version="1.1.1" source="npm" />
gap:plugin name="cordova-plugin-inappbrowser" version="1.0.1" source="npm" />
gap:plugin name="cordova-plugin-media" source="npm" />
gap:plugin name="cordova-plugin-network-information" version="1.2.0" source="npm" />
gap:plugin name="cordova-plugin-splashscreen" source="npm" />

gap:plugin name="cordova-plugin-camera" version="1.2.0" source="npm" />
gap:plugin name="cordova-plugin-media-capture" source="npm" />
gap:plugin name="cordova-plugin-device" version="1.0.1" source="npm" />
gap:plugin name="cordova-plugin-device-motion" source="npm" />
gap:plugin name="cordova-plugin-device-orientation" source="npm" />
gap:plugin name="cordova-plugin-file" version="3.0.0" source="npm" />
gap:plugin name="cordova-plugin-file-transfer" version="1.3.0" source="npm" />
Photo of Yi Ming Kuan

Yi Ming Kuan

  • 1840 Posts
  • 78 Reply Likes
If your issue is Android-specific, add the cordova-plugin-whitelist plugin as per Ryan's post. Remember to also add the new whitelist format to your code: https://github.com/apache/cordova-plugin-whitelist/blob/master/README.md

-yiming
Photo of freelance 84

freelance 84

  • 4 Posts
  • 0 Reply Likes
That's works for me, but I have this problem for iOS

2015-09-28 08:50:40.607 xcodebuild[78796:3310515] [MT] iPhoneSimulator: SimVerifier returned: Error Domain=NSPOSIXErrorDomain Code=53 "Simulator verification failed." UserInfo=0x7fb81ca83560 {NSLocalizedFailureReason=A connection to the simulator verification service could not be established., NSLocalizedRecoverySuggestion=Ensure that Xcode.app is installed on a volume with ownership enabled., NSLocalizedDescription=Simulator verification failed.}
Build settings from command line:
ARCHS = armv7 arm64
CONFIGURATION_BUILD_DIR = /project/build
CORDOVALIB = /project/CordovaLib
ONLY_ACTIVE_ARCH = NO
OTHER_CODE_SIGN_FLAGS = --keychain /secure.keychain
PROVISIONING_PROFILE = 8895e2d2-c38b-4f06-9efd-d1cda3442c09

=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies
2015-09-28 08:41:01.128 xcodebuild[1258:3663678] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 1 returned from shell command: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -x objective-c -c /dev/null 2>&1" UserInfo=0x7fe89480c6f0 {NSLocalizedDescription=Non-zero exit code 1 returned from shell command: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -x objective-c -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory}
2015-09-28 08:41:01.128 xcodebuild[1258:3663678] Warning: Couldn't discover the 'clang' compiler's built-in search paths and preprocessor definitions for language dialect 'objective-c'.
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
Reason: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -x objective-c -c /dev/null 2>&1
2015-09-28 08:41:01.343 xcodebuild[1258:3663678] error: Error Domain=NSPOSIXErrorDomain Code=22 "Non-zero exit code 1 returned from shell command: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -x objective-c -c /dev/null 2>&1" UserInfo=0x7fe894e85e30 {NSLocalizedDescription=Non-zero exit code 1 returned from shell command: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -x objective-c -c /dev/null 2>&1, NSLocalizedFailureReason=Invalid argument}
2015-09-28 08:41:01.344 xcodebuild[1258:3663678] Warning: Couldn't discover the 'clang' compiler's built-in search paths and preprocessor definitions for language dialect 'objective-c'.
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
Reason: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -x objective-c -c /dev/null 2>&1

I have this files
note: android works fine.



my config file

Thanks in advance
Photo of Yi Ming Kuan

Yi Ming Kuan

  • 1840 Posts
  • 78 Reply Likes
You might want to direct future issues with building on your local machine to the Google Group instead: https://groups.google.com/forum/#!forum/phonegap

As for your issue specifically, StackOverflow has a solution: http://stackoverflow.com/questions/29411058/code-53-simulator-verification-failed

-yiming
Photo of freelance 84

freelance 84

  • 4 Posts
  • 0 Reply Likes
Thank you, Do you have the structure for web app? for phonegap version cli-5.2.0 . I don't know if I have something wrong with the structure
Photo of John Roque DeLeon Jorillo

John Roque DeLeon Jorillo

  • 1 Post
  • 0 Reply Likes
thank you so much
Photo of freelance 84

freelance 84

  • 4 Posts
  • 0 Reply Likes
My app is not installed on iOS but in Android works fine.

my version is

cli-5.2.0



Other thing Error - Some official plugins have to be updated if using PhoneGap >= 4.0.0. removed the < from plugins works for me.
Photo of Eldian martin

Eldian martin

  • 4 Posts
  • 0 Reply Likes
I still blur, can help me check, my app id 1634467
Photo of Yi Ming Kuan

Yi Ming Kuan

  • 1840 Posts
  • 78 Reply Likes
As per point 3 mentioned by Ryan, all first party Cordova plugins need to be sourced from NPM.

<gap:plugin name="cordova-plugin-file-transfer" source="npm" />

-yiming
Photo of Eldian martin

Eldian martin

  • 4 Posts
  • 0 Reply Likes
I create new app use phonegap, and replace this.
gap:plugin name="cordova-plugin-battery-status" source="npm" />
gap:plugin name="cordova-plugin-camera" source="npm" />
gap:plugin name="cordova-plugin-media-capture" source="npm" />
gap:plugin name="cordova-plugin-console" source="npm" />
gap:plugin name="cordova-plugin-contacts" source="npm" />
gap:plugin name="cordova-plugin-device" source="npm" />
gap:plugin name="cordova-plugin-device-motion" source="npm" />
gap:plugin name="cordova-plugin-device-orientation" source="npm" />
gap:plugin name="cordova-plugin-dialogs" source="npm" />
gap:plugin name="cordova-plugin-file" source="npm" />
gap:plugin name="cordova-plugin-file-transfer" source="npm" />
gap:plugin name="cordova-plugin-geolocation" source="npm" />
gap:plugin name="cordova-plugin-globalization" source="npm" />
gap:plugin name="cordova-plugin-inappbrowser" source="npm" />
gap:plugin name="cordova-plugin-media" source="npm" />
gap:plugin name="cordova-plugin-network-information" source="npm" />
gap:plugin name="cordova-plugin-splashscreen" source="npm" />
gap:plugin name="cordova-plugin-vibration" source="npm" />

what other step i need to do or any wrong, android still cant build.
Photo of Eldian martin

Eldian martin

  • 4 Posts
  • 0 Reply Likes
Got any post teach beginner step by step from create phonegap apps until can upload to here https://build.phonegap.com/ and get that 3 platform built successfull?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
What about the PGB Docs at http://docs.build.phonegap.com
?
Photo of Yi Ming Kuan

Yi Ming Kuan

  • 1840 Posts
  • 78 Reply Likes
The app id 1634467 is now successfully built for Android and WP8 but not for iOS, as you've not included a key to sign the app with.

-yiming
Photo of Eldian martin

Eldian martin

  • 4 Posts
  • 0 Reply Likes
ya, Thanks for the guide