integrate scandit barcode scanner plugin for cordova app in iOS - 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).

Related

ionic cordova run ios error - Error code 1 for command

I am a newbie of iOS app development. I installed macOs on VMware and use ionic3 framework to development an existed project. It works fine with Android system.
When I run
ionic cordova run ios
get below error:
[17:58:08] tslint: src/pages/welcome/welcome.ts, line: 28
Property 'events' is declared but its value is never read.
L27: private nav: Nav,
L28: private events: Events,
L29: private auth: AuthService,
[17:58:09] lint finished in 4.08 s
FIXME: Implement XCBuild support for macros in overriding parameters with condition sets:
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer
CordovaError: Promise rejected with non-error: 'Error code 1 for command: xcodebuild with args: -xcconfig,/Users/ang/Sense/mobile-app-full/platforms/ios/cordova/build-debug.xcconfig,-workspace,adar.xcworkspace,-scheme,adar,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 12 Pro Max,build,CONFIGURATION_BUILD_DIR=/Users/ang/Sense/mobile-app-full/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/ang/Sense/mobile-app-full/platforms/ios/build/sharedpch'
at /usr/local/lib/node_modules/cordova/bin/cordova:30:15
at processTicksAndRejections (internal/process/task_queues.js:93:5)
[ERROR] An error occurred while running cordova run ios (exit code 1).
Could not find the description and solution of Error code 1 on website.
Thanks for checking my issue.

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!

React native build to device failed

I'm trying to build to an iOS device, building to simulator works fine.
This is what I get:
uncaught error Error: TypeError: unsupported file type at lookup (/Users/NAME/git/vex/vex-app react/VexAppReact/node_modules/image-size/lib/index.js:35:9)
at /Users/NAME/git/vex/vex-app-react/VexAppReact/node_modules/image-size/lib/index.js:93:22
at /Users/NAME/git/vex/vex-app-react/VexAppReact/node_modules/image-size/lib/index.js:50:9
at /Users/NAME/git/vex/vex-app-react/VexAppReact/node_modules/graceful-fs/graceful-fs.js:43:10
at FSReqWrap.oncomplete (fs.js:82:15)
See logs /var/folders/h8/42h3w_qd2r9fvpwy99jsnjq40000gn/T/react-packager.log
at SocketClient._handleMessage (SocketClient.js:144:23)
at BunserBuf. (SocketClient.js:53:42)
at emitOne (events.js:90:13)
at BunserBuf.emit (events.js:182:7)
at BunserBuf.process (/Users/NAME/git/vex/vex-app-react/VexAppReact/node_modules/bser/index.js:289:10)
at /Users/NAME/git/vex/vex-app react/VexAppReact/node_modules/bser/index.js:244:12
at nextTickCallbackWith0Args (node.js:452:9)
at process._tickCallback (node.js:381:13)
Command /bin/sh failed with exit code 1
I'm assuming there's something wrong with image assets. I didn't install the image-size node module myself, so I doubt there's something wrong with that module, it could be though.
Any suggestions welcome.
Solution: apparently you can't add png files to native ios build

Ionic Framwork error when trying to add ios platform project

I was trying to create a new Ionic project and when I ran the command:
ionic platform add ios
I got the following error at the end:
Running command:
/Users/nnation/myApp/hooks/after_prepare/010_add_platform_class.js
/Users/nnation/myApp Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1162:11)
at Object.exports.spawn (child_process.js:995:9)
at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31)
at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:23)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:131:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:114:20
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)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
I am not sure what that ment, so i ran it again and I got the following:
$ sudo ionic platform add ios running cordova platform add ios
Platform ios already added.
Thinking that everything is good i then ran:
$ sudo ionic build ios
And then this happen again:
running cordova build ios Running command:
/Users/nnation/myApp/hooks/after_prepare/010_add_platform_class.js
/Users/nnation/myApp Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1162:11)
at Object.exports.spawn (child_process.js:995:9)
at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31)
at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:23)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:131:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:114:20
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)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
Can someone assist me in figuring what is wrong or what i am missing? I am running MacOS.
I solved this problem using ionic hooks add.
Found it here

Errors when trying to build iOS with cordova in Mavericks (10.9.1)

Days ago I built the application for Android, zero problems, but now, when I try to do the same for iOS (obviously not the same commands) I always receive an error.
I use the following command:
cordova platform add ios
And I get the following error:
Downloading cordova library for ios...
Download complete
Creating ios project...
Error: An error occured during creation of ios sub-project.
File "/Users/xxxxx/.cordova/lib/ios/cordova/3.3.0/bin/update_cordova_subproject", line 31
print __doc__
^
SyntaxError: invalid syntax
at /usr/local/lib/node_modules/cordova/src/platform.js:282:30
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
I tried also with:
phonegap build ios
But I get the same error and I don't know how to fix it. I've been looking on the Internet and I found some guy with the same problem but nobody could help him.
I run the commands with sudo, that isn't the problem.
I recently got the same error.
My problem was that I'm using Python3 by default. print in Python2 is a statement wherease in Python3 it's a function.
.cordova/lib/ios/cordova/3.3.0/bin/update_cordova_subproject has a shebang that calls /bin/python.
I had to replace #!/bin/python with #!/bin/python2.7 to use python2.7 on this script.
I have the exactly same problem with you. However, the way replace "#!/bin/python with #!/bin/python2.7" doesn't work for me.
Inspired by the explanation of Matthieu Riegler, I change print __doc__ to print(__doc__) in line 31 and print line to print(line) in line 97. Eventually, it works.

Resources