Phonegap-plugin-barcodescanner: Some Error on the Cordova

Created on 31 May 2018  路  10Comments  路  Source: phonegap/phonegap-plugin-barcodescanner

Expected Behaviour

Open the Camera and scan the barcode.

Actual Behaviour

can't open the Camera.

Reproduce Scenario (including but not limited to)

When I adding the plugin,I don't type anything in the ANDROID_SUPPORT_V4_VERSION.
and go to compiler Cordova.
Here is the Error Message:
1>MSBUILD : cordova-build error : AAPT err(Facade for 7873436): D:\Glove\Documents\Visual Studio 2015\Projects\callkit_test\barcodescanner\platforms\android\build\intermediates\exploded-aar\barcodescanner\res\drawable\toggle_torch.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited 1> AAPT err(Facade for 7873436): D:\Glove\Documents\Visual Studio 2015\Projects\callkit_test\barcodescanner\platforms\android\build\intermediates\exploded-aar\barcodescanner\res\drawable\toggle_torch.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited 1> :mergeDebugResources 1> :processDebugManifest 1> :processDebugResources FAILED 1> 1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception. 1> FAILURE: Build failed with an exception. 1> 1>MSBUILD : cordova-build error : * What went wrong: 1> * What went wrong: 1>MSBUILD : cordova-build error : Execution failed for task ':processDebugResources'. 1> Execution failed for task ':processDebugResources'. 1>MSBUILD : cordova-build error : > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.1\aapt.exe'' finished with non-zero exit value 1 1> > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.1\aapt.exe'' finished with non-zero exit value 1 1> 1>MSBUILD : cordova-build error : * Try: 1> * Try: 1> 1> BUILD FAILED 1> 1> Total time: 10.74 secs 1>MSBUILD : cordova-build error : Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 1> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 1>MSBUILD : cordova-build error : Error code 1 for command: cmd with args: /s,/c,""D:\Glove\Documents\Visual Studio 2015\Projects\callkit_test\barcodescanner\platforms\android\gradlew" cdvBuildDebug -b "D:\Glove\Documents\Visual Studio 2015\Projects\callkit_test\barcodescanner\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true" 1> Error code 1 for command: cmd with args: /s,/c,""D:\Glove\Documents\Visual Studio 2015\Projects\callkit_test\barcodescanner\platforms\android\gradlew" cdvBuildDebug -b "D:\Glove\Documents\Visual Studio 2015\Projects\callkit_test\barcodescanner\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

And I try the Add "24.1.1" in the ANDROID_SUPPORT_V4_VERSION textbox,
It can compiler success.but I open the app,the app said
'scan' is not the funciton
I am using the example in Your Readme

Steps to Reproduce

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Cordova CLI version and cordova platform version

I using Visual Studio 2015.
Cordova CLI 6.1.1.
Cordova Android 5.1.1

Plugin version

8.0.0 phonegap-plugin-barcodescanner

Sample Code that illustrates the problem

cordova.plugins.barcodeScanner.scan( function (result) { alert("We got a barcode\n" + "Result: " + result.text + "\n" + "Format: " + result.format + "\n" + "Cancelled: " + result.cancelled); }, function (error) { alert("Scanning failed: " + error); }, { preferFrontCamera : true, // iOS and Android showFlipCameraButton : true, // iOS and Android showTorchButton : true, // iOS and Android torchOn: true, // Android, launch with the torch switched on (if available) saveHistory: true, // Android, save scan history (default false) prompt : "Place a barcode inside the scan area", // Android resultDisplayDuration: 500, // Android, display scanned text for X ms. 0 suppresses it entirely, default 1500 formats : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED orientation : "landscape", // Android only (portrait|landscape), default unset so it rotates with the device disableAnimations : true, // iOS disableSuccessBeep: false // iOS and Android } );

Logs taken while reproducing problem

Thank You
Johnny

All 10 comments

the 8.0.0 version of the plugin requires cordova-android >= 6.3.0 and cordova >= 7.1.0, so the plugin is probably not installed for the platform

Hi Jcesarmobile
Thank you for your fast reply.

Can I know Which Barcode plugin version can run on the Visual Studio 2015 Cordova?
Cordova CLI 6.1.1
Cordova Android 5.1.1

I originally used Version6.0.8. But 2 days ago,I can't compiler my code with the barcode plugin.

Thank you.
Johnny

Hi Jcesarmobile, i have the same problem i can't run phonegap-plugin-barcodescanner on visual studio 2015, cordova CLI 6.1.1, Cordova Android 5.1.1

There is a solution, which version can run on cordova cli 6.1.1.

i used old version but i have the same error.

Thank you.
Daniel

Google break things when they release new support versions. That's is fixed in current plugin version, but we can't backport all the changes to older versions of the plugin. You'll have to update your cordova version or do the required changes yourselves in your plugin version.

Hi jcesarmobile, Thank you for your reply.

but how i can update my cordova version in visual studio 2015?

is difficult to modify the 6.0.8 for fix the error?

because i need the plugin for my clients.

Hi jcesarmobile,

Here also same problem (Android Studio),

Installed platforms
android 5.2.2

Error log :

Plugin doesn't support this project's cordova-android version. cordova-android:
5.2.2, failed version requirement: >=6.3.0

Skipping 'phonegap-plugin-barcodescanner' for android

Adding phonegap-plugin-barcodescanner to package.json

Saved plugin info for "phonegap-plugin-barcodescanner" to config.xml

Issue ::
After installing plugin is not available inside assets - > www - > plugins

Please let me know how to solve this issue as soon as possible .

We are not reverting anything, update your cordova-android or downgrade the plugin

Hi jcesarmobile,

Here also same problem (Android Studio),

Installed platforms
android 5.2.2

Error log :

Plugin doesn't support this project's cordova-android version. cordova-android:
5.2.2, failed version requirement: >=6.3.0

Skipping 'phonegap-plugin-barcodescanner' for android

Adding phonegap-plugin-barcodescanner to package.json

Saved plugin info for "phonegap-plugin-barcodescanner" to config.xml

Issue ::
After installing plugin is not available inside assets - > www - > plugins

Please let me know how to solve this issue as soon as possible .

upgrade your cordova-android to 6.3.0 or newer, or use 6.x.x version of the plugin

This thread has been automatically locked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

justinhenricks picture justinhenricks  路  5Comments

luckylooke picture luckylooke  路  6Comments

SunboX picture SunboX  路  9Comments

thomas-tran picture thomas-tran  路  9Comments

ghost picture ghost  路  5Comments