Could not get unknown property 'PLAY_SERVICES_VERSION' - Phonegap Build (cordova-plugin-googleplus) - cordova-plugins

I am getting 'Could not get unknown property 'PLAY_SERVICES_VERSION'' error in Phonegap build when including cordova-plugin-googleplus plugin.
Build is successful if i set this plugin version to 5.2.1. The same problem with facebook and notification plugin.
phonegap-plugin-push (1.6.0)
cordova-plugin-facebook4 (1.7.4)
Is there any way to solve this? Thanks!

Downgrade your cordova-plugin-googleplus:
cordova plugin add cordova-plugin-googleplus#5.3.1 --save --variable REVERSED_CLIENT_ID=XXXXXXXX
or
downgrade your-cordova-plugin
which doesn't have PLAY_SERVICES_VERSION

I think you can just add the variable, though...
<plugin name="cordova-plugin-googleplus" spec="^5.3.2">
<variable name="PLAY_SERVICES_VERSION" value="16.0.0" />
</plugin>

Related

Unable to install Cordova plugin barcode Phonegap (mac)

I'm super new to cordova and phonegap. I need to install the Cordova plugin barcodescanner and I have tried to do so through the Terminal (mac) with the following line:
cordova plugin add cordova-plugin-barcodescanner as specified in this document.
However, I get an error that I can not solve. I've read many other posts, and haven't found a solution for my case.
My error:
(node:1721) UnhandledPromiseRejectionWarning: CordovaError: Cannot
find plugin.xml for plugin "cordova-plugin-barcodescanner". Please
try adding it again.
at new PluginInfo
(/usr/local/lib/node_modules/cordova/node_modules/cordova-
common/src/PluginInfo/PluginInfo.js:367:15)
at PluginInfoProvider.get
(/usr/local/lib/node_modules/cordova/node_modules/cordova-
common/src/PluginInfo/PluginInfoProvider.js:35:32)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/src/plugman/fetch.js:177:51
at _fulfilled
(/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/node_modules/q/q.js:787:54)
at self.promiseDispatch.done
(/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch
(/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/node_modules/q/q.js:509:49
at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
(node:1721) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated either by throwing inside of an
async function without a catch block, or by rejecting a promise
which
was not handled with .catch(). (rejection id: 1)
(node:1721) [DEP0018] DeprecationWarning: Unhandled promise
rejections
are deprecated. In the future, promise rejections that are not
handled
will terminate the Node.js process with a non-zero exit code.
These are my specs:
iOS: 10.13.4
Phonegap: 0.4.5
Thanks! :)
https://github.com/hypery2k/cordova-barcodescanner-plugin Try to use full url for installing plugin.
or
2.Set <plugin name="cordova-plugin-barcodescanner" spec="0.7.4" /> to config.xml and try run cordova plugin add cordova-plugin-barcodescanner with your cmd.
If it doesn't work try to run command npm install cordova-plugin-barcodescanner. (if your command already add some files to plugin folder, remove it and run it again.)
Check the path you are trying to install plugin, it must be something like C:/Desktop/Application/www/plugin/
Be sure that your config.xml have:
<config-file target="AndroidManifest.xml" parent="/*" mode="merge">
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
</config-file>
Ok, I figured out after many days and trials.
Basically what I did was create a new project from scratch, using CLI. Then I followed step by step this documentation. When I got to the "plugin" section, I added the plugin I wanted with the following line:
cordova plugin add cordova-plugin-barcodescanner
Hope this helps other people.
Cheers!

ionic 3 cannot add onesignal-cordova-plugin into ios platform. Error: rbenv: pod: command not found

I am trying to integrate onesignal to ios. when i execute the command
ionic cordova platform add ios
it fails with the following:
Discovered plugin "onesignal-cordova-plugin" in config.xml. Adding it to the project
Installing "onesignal-cordova-plugin" for ios
Failed to install 'onesignal-cordova-plugin': undefined
Failed to restore plugin "onesignal-cordova-plugin" from config.xml. You might need to try adding it again. Error: rbenv: pod: command not found
The `pod' command exists in these Ruby versions:
2.1.2
Here is excerpts of my config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.app.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
...
<plugin name="cordova-plugin-network-information" spec="^1.3.4" />
<plugin name="onesignal-cordova-plugin" spec="^2.2.5" />
<engine name="ios" spec="~4.5.4" />
</widget>
You need to install cocoapods for using OneSignal SDK with IOS platform. Check the documentation here
Do:
sudo gem install cocoapods
pod repo update
Suggest you go through this post in case Ruby Gems is not installed.

Phonegap build fails with splash screen

I'm attempting to use the new phonegap build with CLI 7.0.1
The build fails with this error:
The following build commands failed:
CompileAssetCatalog /Library/Developer/Xcode/DerivedData/Our_HNZC_Learning_space-ddfmniquktwfmabpvilymbvzreak/Build/Intermediates/ArchiveIntermediates/Our\ HNZC\ Learning\ space/InstallationBuildProductsLocation/Applications/Our\ HNZC\ Learning\ space.app Our\ HNZC\ Learning\ space/Images.xcassets
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/private/project/cordova/build-release.xcconfig,-workspace,Our HNZC Learning space.xcworkspace,-scheme,Our HNZC Learning space,-configuration,Release,-destination,generic/platform=iOS,-archivePath,Our HNZC Learning space.xcarchive,archive,CONFIGURATION_BUILD_DIR=/private/project/build/device,SHARED_PRECOMPS_DIR=/private/project/build/sharedpch
I've added these to config.png
<icon src="res/icon.png" />
<splash src="res/splash.png" />
And I've added this plugin
<plugin name="cordova-plugin-splashscreen" />
And the files are in the right place.
Splash works fine, Icon is causing the error
Not sure what the exact problem is based upon the info you provided.
A starting point would be to remove the splashscreen plugin and re-add it:
cordova plugin remove cordova-plugin-splashscreen
cordova plugin add cordova-plugin-splashscreen
cordova prepare
I would suggest using an Icon and Splashscreen generator such as this one: http://phonegap.appiq.software/
It does all of the hard work for you and gives you the exact code for your config.xml
I hope this is helpful.

PhoneGap Windows Build Fail with Cordova Push phonegap-plugin-push 1.8.0

I built an APP using cordova with push notification plugin. I built it using PhoneGap, it successfully built and working for Android and IOS but i get an error on windows build...
Versions
PhoneGap (iOS / Android / Windows)
cli-6.5.0 (4.3.1 / 6.1.2 / 4.4.3)
PhoneGap Log:
Build Date: 2017-11-08 00:12:04 +0000
--------------------------------------------------------------------------------
PLUGIN OUTPUT
--------------------------------------------------------------------------------
Fetching plugin "cordova-plugin-statusbar#~2.1.3" via npm
Installing "cordova-plugin-statusbar" at "2.1.3" for windows
"plugman.cmd install --platform windows --project /cygwin/project --plugin phonegap-plugin-push#~1.8.0 --var SENDER_ID=990801368143": Fetching plugin "phonegap-plugin-push#~1.8.0" via npm
Installing "phonegap-plugin-push" at "1.8.4" for windows
Updating appxmanifests with ToastCapable=true...
Failed to install 'phonegap-plugin-push': Error: Cannot find module 'C:\project\platforms\windows\cordova\lib\AppxManifest'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at module.exports (C:\project\cordova\plugins\phonegap-plugin-push\hooks\windows\setToastCapable.js:5:24)
at runScriptViaModuleLoader (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:189:18)
at runScript (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:165:16)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:133:20
at _fulfilled (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\q\q.js:816:30)
Cannot find module 'C:\project\platforms\windows\cordova\lib\AppxManifest'
PhoneGap Build Error:
Error - Plugin error (you probably need to remove plugin files from your app): Fetching plugin "phonegap-plugin-push#~1.8.0" via npm Installing "phonegap-plugin-push" at "1.8.4" for windows Updating appxmanifests with ToastCapable=true... Failed to install 'phonegap-plugin-push': Error: Cannot find module 'C:\cygwin\tmp\gimlet\xxxxxxxx\project\platforms\windows\cordova\lib\AppxManifest' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at module.exports (C:\cygwin\tmp\gimlet\xxxxxxxx\project\cordova\plugins\phonegap-plugin-push\hooks\windows\setToastCapable.js:5:24) at runScriptViaModuleLoader (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:189:18) at runScript (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:165:16) at C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:133:20 at _fulfilled (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\q\q.js:787:54) at self.promiseDispatch.done (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\q\q.js:816:30) Cannot find module 'C:\cygwin\tmp\gimlet\2870062\project\platforms\windows\cordova\lib\AppxManifest' - You can fix this here
My config.xml:
<plugin name="cordova-plugin-statusbar" source="npm" spec="~2.1.3" />
<plugin name="phonegap-plugin-push" source="npm" spec="~1.8.0">
<variable name="SENDER_ID" value="my_firebase_id" />
</plugin>
<plugin name="cordova-plugin-battery-status" source="npm" spec="~1.1.1" />
I have tried changing the versions but no luck... anyone have any idea why?
I found a solution... The problem was PhoneGap only works with push notification 1.8.1
so changed my config.xml files like this
<plugin name="phonegap-plugin-push" source="npm" spec="1.8.1">
<variable name="SENDER_ID" value="my_firebase_id" />
</plugin>

error : package com.google.android.gms.auth does not exist in ant release in cordova app

I installed cordova-plugin-googleplus plugin to login using google. After installing I run "cordova build andriod" in CLI, it was successful and apk file works fine for google login. Then for releasing the app I run "ant release" in platforms/android folder in CLI, then build failed with errors like " package com.google.android.gms.auth does not exist import com.google.android.gms.auth". Please give me the solution for this.
Thanks in advance.
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/252
Replace
<framework src="com.google.android.gms:play-services-plus:+" />
<framework src="com.google.android.gms:play-services-identity:+" />
with
<framework src="com.google.android.gms:play-services-plus:9.0.2" />
<framework src="com.google.android.gms:play-services-identity:9.0.2" />
in both plugin.xml as well as platforms/android/project.properties. In my case if I replace only plugin.xml then build.gradle was getting overridden with project.properties content and + version was being used instead of specific version

Resources