Unable to install Cordova plugin barcode Phonegap (mac) - cordova-plugins

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!

Related

PhoneGap Build Failing for iOS though It Works for Android Fine

I tried to run the Adobe PhoneGap build for a hybrid App. It worked fine for Android but failed for iOS though everything was working OK earlier. I have updated the phonegap-version as the following:
<preference name='phonegap-version' value='cli-8.0.0' />
The error log shows the following:
copy splash.png ../../../../private/project/www/splash.png (new file)
TypeError: Cannot read property 'indexOf' of null
at parseWhitelistUrlForATS (/private/project/cordova/lib/prepare.js:1038:26)
at /private/project/cordova/lib/prepare.js:965:23
at Array.reduce (native)
at processAccessAndAllowNavigationEntries (/private/project/cordova/lib/prepare.js:956:10)
at writeATSEntries (/private/project/cordova/lib/prepare.js:1081:16)
at updateProject (/private/project/cordova/lib/prepare.js:217:15)
at /private/project/cordova/lib/prepare.js:59:20
at _fulfilled (/private/project/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (/private/project/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (/private/project/cordova/node_modules/q/q.js:816:13)
before ending. Please help.
I just changed the CLI version to cli-6.5.0
<preference name='phonegap-version' value='cli-6.5.0' />
and it worked. It looks higher version creates issues.

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

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>

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

How do I perform a remote build for iOS using PhoneGap on Windows?

This is my first hybrid App. I'm getting about a dozen of these error message
C:\Users\Chloe\workspace\TypeFunctions>phonegap remote build ios
[phonegap] compressing the app...
rm: could not remove file (code EBUSY): C:\Users\Chloe\workspace\TypeFunctions\build\www/lib/images/icons-svg/mail-black.svg
There is only 1 search result on the entire web.
My target platform is Windows 8.1. I am using PhoneGap 5.4.0.
Strange, I tried it again, but now I got a different error. No mention of what the error was though. Terrible software.
C:\Users\Chloe\workspace\TypeFunctions>phonegap remote build ios
[phonegap] compressing the app...
skipping existing file: mail-black.svg
skipping existing file: tag-white.svg
skipping existing file: user-black.svg
skipping existing file: user-white.svg
[phonegap] uploading the app...
[phonegap] building the app...
[error] error occured while building the ios app
I managed to get a stack trace.
Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\Chloe\workspace\TypeFunctions\build'
at rethrow (fs.js:48:21)
at maybeCallback (fs.js:66:42)
at Object.fs.rmdir (fs.js:797:14)
at Object.module.exports.cleanup (C:\Users\Chloe\AppData\Roaming\npm\node_modules\phonegap\node_modules\phonegap-build\lib\phonegap-build\create\zip.js:119:16)
at Object.callback (C:\Users\Chloe\AppData\Roaming\npm\node_modules\phonegap\node_modules\phonegap-build\lib\phonegap-build\build\remote.js:71:21)
at Request._callback (C:\Users\Chloe\AppData\Roaming\npm\node_modules\phonegap\node_modules\phonegap-build-api\lib\api.js:229:26)
at Request.self.callback (C:\Users\Chloe\AppData\Roaming\npm\node_modules\phonegap\node_modules\phonegap-build-api\node_modules\request\main.js:122:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (C:\Users\Chloe\AppData\Roaming\npm\node_modules\phonegap\node_modules\phonegap-build-api\node_modules\request\main.js:655:16)
Additional Information
The EBUSY and ENOTEMPTY errors were caused by guard running. It might be possible to have it run with -w option.
I'm still getting the [error] error occured while building the ios app without reason. I'm using PhoneGap CLI and PhoneGap Build. I thought that part was obvious with the actual command line provided. The target platform was iOS. I thought that was given away by the command line too. The (default) platform tags in config.xml are
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<engine name="ios" spec="~3.9.2" />
The app was created with the jQuery template and command phonegap create myApp --template jquery-mobile-starter and then modified.

integrate scandit barcode scanner plugin for cordova app in iOS

i am trying to integrate the Scandit Barcode scannner plugin to my cordova based application for iOS platform, but am unable to accomplish that. i have tried the following steps:
1) downloaded the SDK for Phonegap/Cordova and extracted it to a folder.
2) using the Cordova CLI, i executed the following command:
cordova plugin add <path to the folder>
i get the following error when i run that:
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: Parsing /Users/macuser/Desktop/AppBackup/miniOrangeAuthenticator/platforms/ios/miniOrange Authenticator/config.xml failed:
ENOENT, no such file or directory '/Users/macuser/Desktop/AppBackup/ProjectName/platforms/ios/miniOrange Authenticator/config.xml'
at Object.config_parser (/usr/local/lib/node_modules/cordova/src/config_parser.js:28:15)
at Object.ios_parser (/usr/local/lib/node_modules/cordova/src/metadata/ios_parser.js:62:19)
at /usr/local/lib/node_modules/cordova/src/plugin.js:98:46
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:821:14
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
macmans-MacBook-Air:ProjectName macuser$
what may be the reason? is there any other way i canaccomplish it (without CLI) ?
Change miniOrange Authenticator to miniOrangeAuthenticator. I don't think the CLI is a big fan of spaces (I have had problems in the past with them).

Resources