Giter Site home page Giter Site logo

mono0926 / barcode_scan2 Goto Github PK

View Code? Open in Web Editor NEW
76.0 6.0 68.0 396 KB

[reborned barcode_scan] A flutter plugin for reading 2D barcodes and QR codes.

Home Page: https://pub.dev/packages/barcode_scan2

License: MIT License

Kotlin 23.45% Ruby 2.64% Swift 32.96% Objective-C 0.81% Dart 39.34% Shell 0.80%
scan scanner qrcode barcode reader barcode-scanner barcode-reader qrcode-scanner qrcode-reader

barcode_scan2's Introduction

GitHub license GitHub stars Pub GitHub forks

Reborned🎉

Original barcode_scan was discontinued, so barcode_scan2 was borned with sound null safety support🎉

barcode_scan2

A flutter plugin for scanning 2D barcodes and QR codes.

This provides a simple wrapper for two commonly used iOS and Android libraries:

Features

  • Scan 2D barcodes
  • Scan QR codes
  • Control the flash while scanning
  • Permission handling

Getting Started

Android

For Android, you must do the following before you can use the plugin:

  • Add the camera permission to your AndroidManifest.xml

    <uses-permission android:name="android.permission.CAMERA" />

  • This plugin is written in Kotlin. Therefore, you need to add Kotlin support to your project. See installing the Kotlin plugin.

Edit your project-level build.gradle file to look like this:

buildscript {
    ext.kotlin_version = '1.3.61'
    // ...
    dependencies {
        // ...
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
// ...

Edit your app-level build.gradle file to look like this:

apply plugin: 'kotlin-android'
// ...
dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    // ...
}

Now you can depend on the barcode_scan plugin in your pubspec.yaml file:

dependencies:
    # ...
    barcode_scan2: any

Click "Packages get" in Android Studio or run flutter packages get in your project folder.

iOS

To use on iOS, you must add the the camera usage description to your Info.plist

<dict>
    <!-- ... -->
    <key>NSCameraUsageDescription</key>
    <string>Camera permission is required for barcode scanning.</string>
    <!-- ... -->
</dict>

Usage

import 'package:barcode_scan2/barcode_scan2.dart';

void main() async {
  var result = await BarcodeScanner.scan();

  print(result.type); // The result type (barcode, cancelled, failed)
  print(result.rawContent); // The barcode content
  print(result.format); // The barcode format (as enum)
  print(result.formatNote); // If a unknown format was scanned this field contains a note
}

Advanced usage

You can pass options to the scan method:

import 'package:barcode_scan2/barcode_scan2.dart';

void main() async {

  var options = ScanOptions(
    // set the options
  );

  var result = await BarcodeScanner.scan(options: options);

  // ...
}

Supported options

Option Type Description Supported by
strings.cancel String The cancel button text on iOS iOS only
strings.flash_on String The flash on button text iOS + Android
strings.flash_off String The flash off button text iOS + Android
restrictFormat BarcodeFormat[] Restrict the formats which are recognized iOS + Android
useCamera int The index of the camera which is used for scanning (See BarcodeScanner.numberOfCameras) iOS + Android
autoEnableFlash bool Enable the flash when start scanning iOS + Android
android.aspectTolerance double Enable auto focus on Android Android only
android.useAutoFocus bool Set aspect ratio tolerance level used in calculating the optimal Camera preview size Android only

Development setup

Setup protobuf

Mac:

$ brew install protobuf
$ brew install swift-protobuf

Windows / Linux: https://github.com/protocolbuffers/protobuf#protocol-compiler-installation

Activate the protobuf dart plugin:

$ flutter pub global activate protoc_plugin

Install theProtobuf Support plugin for IDEA / Android Studio or vscode-proto3 for VS Code

If you changed the protos.proto you've to execute the ./generate_proto.sh to update the dart / swift sources

Common problems

Android "Could not find org.jetbrains.kotlin:kotlin-stdlib-jre..."

Change org.jetbrains.kotlin:kotlin-stdlib-jre to org.jetbrains.kotlin:kotlin-stdlib-jdk (StackOverflow)

barcode_scan2's People

Contributors

ammaratef45 avatar barredterra avatar bcko avatar bensower avatar bydllhcbn avatar connectety avatar davidebicego avatar devtronic avatar dustin-graham avatar edreanernst avatar eneskaraosman avatar ethael avatar ethi1989 avatar johnpryan avatar leontappe avatar lookfirst avatar matthewtsmith avatar mjafartp avatar mono0926 avatar muzammil-bilwani avatar namanshergill avatar nicolasconnault avatar robinbonnes avatar santiihoyos avatar slimyjimmy avatar tgezginis avatar toteto avatar ulfsauer0815 avatar victoraldir avatar yukio-output avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

barcode_scan2's Issues

[Bug] ZXingAutofocusScannerView.java error: getParameters failed

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
If applicable, add the verbose output of flutter run.

Environment (please complete the following information):

  • iOS? Version: ...
  • Android? Version: ...
  • Real Device? Which?: ...
  • Emulator/Simulator? Which?: ...
  • Version of barcode_scan
  • Output of flutter --version:
Flutter ...

Additional context
Add any other context about the problem here.

[Bug] SwiftBarcodeScanPlugin.swift deprecated code

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
A build warning that .devices(for:) is deprecated

'devices(for:)' was deprecated in iOS 10.0: Use AVCaptureDeviceDiscoverySession instead.
File: SwiftBarcodeScanPlugin.swift
Function: public func handle
Line: 23

result(AVCaptureDevice.devices(for: .video).count)

To Reproduce
Steps to reproduce the behavior:

  1. Open in Xcode
  2. Build

Expected behavior
Expected no error

Screenshots

Logs

Environment (please complete the following information):

  • Version of barcode_scan 4.1.4
  • Output of flutter --version:
Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f4abaa0735 (9 weeks ago) • 2021-07-01 12:46:11 -0700
Engine • revision 241c87ad80
Tools • Dart 2.13.4

Additional context
Only warnings at this stage

[Bug] Unusual camera artefacts when aspectTolerance = 0.00 or 1.00

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
The camera view in the barcode scanner view is skewed and morphed in unusual ways whenever the aspectTolerance is 0.00
The aspect ratio of the camera view becomes really weird.

To Reproduce
Steps to reproduce the behavior:

  1. Set the aspectTolerance to 0.00 or 1.00 and set autofocus to true
  2. Open the barcode scanner
  3. The first couple of milliseconds the camera view is normal
  4. See the error whenever you point the phone to any rectangular object, the object doesn't look normal on the barcode scan view. The ratio of the object has changed and when you rotate your phone the 90 degrees angles of the object change.

Expected behavior
The camera view should be normal (unchanged)

Screenshots
https://ibb.co/6sTxZGL

Logs
None

Environment (please complete the following information):

  • Android 11
  • Real Device: Samsung galaxy A70
  • Version of barcode_scan: 4.1.3

Additional context
None.

[Bug] "Configure project :barcode_scan2" very slow

Describe the bug

A fresh build of an app using this plugin slows down the build process.

To Reproduce

Bulding an app using this plugin. Run flutter build apk -v. See the logs:

[+27907 ms] > Configure project :barcode_scan2
[        ] The com.google.protobuf plugin was already applied to the project: :barcode_scan2 and will not be applied again after plugin: android-library
[ +686 ms] WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
[        ] It will be removed at the end of 2019.
[        ] For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
[        ] To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
[+63098 ms] Checking the license for package Android SDK Build-Tools 28.0.3 in /opt/android-sdk-linux/licenses

As you can see, the Configure project :barcode_scan2 needs 63s. (20% of the whole build time)

Expected behavior

The Configure project :barcode_scan2 should be faster, since it slows down the app build drastically.

Screenshots

See To Reproduce

Logs

See To Reproduce

Environment (please complete the following information):

  • gitlab-runner with image cirrusci/flutter:2.2.2
  • barcode_scan2: ^4.1.3
  • flutter: 2.2.2

Additional context

n/a

[Feature Request]提供自定义UI

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[Bug] JCenter not available anymore, replace with MavenCentral

Describe the bug
Since JCenter is going down, the build.gradle file should be updated to use mavenCentral() instead of jcenter(). However, if changed manually, zxing could not be found also, as the used version is not in Maven anymore: https://repo.maven.apache.org/maven2/me/dm7/barcodescanner/zxing/1.9.13/zxing-1.9.13.pom

To Reproduce
Steps to reproduce the behavior:

  1. Include barcode_scan2 latest version in pubspec.yml
  2. Run flutter build apk
  3. If not already downloaded, a validity check error for jcenter.bintray.com comes up.

Expected behavior
The app should build.

Screenshots

Logs

> Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
     Required by:
         project :barcode_scan2 > com.android.tools.build:gradle:3.5.3 > com.android.tools.build:builder:3.5.3 > com.android.tools:sdklib:26.5.3 > com.android.tools:repository:26.5.3
      > Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
         > Could not get resource 'https://jcenter.bintray.com/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.pom'.
               > PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed

Environment (please complete the following information):

  • iOS? Version: ...
  • Android? Version: 30
  • Real Device? Which?: ...
  • Emulator/Simulator? Which?: ...
  • Version of barcode_scan
  • Output of flutter --version:
Flutter v 2.5.3

Additional context

How Change TItle name?

Is your feature request related to a problem? Please describe.
For now is use app name in titile.
but I need change it.

Describe the solution you'd like
i want to change title
exsample my app name is 'Wellcome',
so title is Wellcome, but I need change to 'Scan EAN BarCode'

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[Bug] Class 'ActivityHelper' is not abstract when trying to compile to android?

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
i try to build a flutter app that scans a QR code, but it fails in the lib directly??

To Reproduce
follow the instructions to enable the barcode_scan2 lib (i added a 2 at each end of the name for pubspec dependency and lib include)
and just try to compile it

Expected behavior
a working binary

Screenshots

Logs
Launching lib/main.dart on Pixel 4a in debug mode...
Running Gradle task 'assembleCompleteDebug'...
e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/ActivityHelper.kt: (16, 1): Class 'ActivityHelper' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/ActivityHelper.kt: (71, 5): 'onRequestPermissionsResult' overrides nothing
e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/ActivityHelper.kt: (81, 58): Type mismatch: inferred type is Array<CapturedType(out String)>? but Array<(out) String!> was expected
e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/ActivityHelper.kt: (81, 71): Type mismatch: inferred type is IntArray? but IntArray was expected
e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/ChannelHandler.kt: (64, 39): Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected
e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/RequestCameraPermissionHandler.kt: (8, 1): Class 'RequestCameraPermissionHandler' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/RequestCameraPermissionHandler.kt: (11, 5): 'onRequestPermissionsResult' overrides nothing

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':barcode_scan2:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 7s
Exception: Gradle task assembleCompleteDebug failed with exit code 1

Environment (please complete the following information):

  • iOS? Version: ...
  • Android? Version: 31
  • Real Device? Which?: pixel 4a
  • Emulator/Simulator?none.
  • Version of barcode_scan 4.2
  • Output of flutter --version:
Flutter ...2.12.0-4.1.pre

Additional context
Add any other context about the problem here.

Replace jCenter? Can't build app with jCenter

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
Hi, thanks for the package

I see this is still using jCenter() which has been deprecated https://blog.gradle.org/jcenter-shutdown
any chance of moving to mavenCentral()?

I can't build my project

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':barcode_scan2'.
> Could not resolve all artifacts for configuration ':barcode_scan2:classpath'.
   > Could not download protobuf-gradle-plugin-0.8.18.jar (com.google.protobuf:protobuf-gradle-plugin:0.8.18)
      > Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-gradle-plugin/0.8.18/protobuf-gradle-plugin-0.8.18.jar'.
         > Could not GET 'https://jcenter.bintray.com/com/google/protobuf/protobuf-gradle-plugin/0.8.18/protobuf-gradle-plugin-0.8.18.jar'.
            > Read timed out
> Failed to notify project evaluation listener.
   > Could not get unknown property 'android' for project ':barcode_scan2' of type org.gradle.api.Project.
   > Could not get unknown property 'android' for project ':barcode_scan2' of type org.gradle.api.Project.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10m 0s

To Reproduce
Steps to reproduce the behavior:

  1. Build debug

Expected behavior
Can build an app

Screenshots

Logs

Environment (please complete the following information):

  • Android? Version: min SDK 21
  • Version of barcode_scan = 4.2.1
  • Output of flutter --version:
Flutter 2.10.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision db747aa133 (9 months ago) • 2022-02-09 13:57:35 -0600
Engine • revision ab46186b24
Tools • Dart 2.16.1 • DevTools 2.9.2

Additional context

怎样删除左上角的应用名

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[Bug] Camera flash doesn't turn on

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
The front camera flash doesn't turn on at all. I'm using a Samsung Galaxy J6 phone (which has a flash with the front camera as well).

To Reproduce
Just run the provided example from the docs with a phone that has a front camera + flashlight.

Expected behavior
When using a camera which has a flashlight capability I expect it to turn on when I click the (turn on button).

Screenshots
Cant really provide a screenshot on this one.

Logs
No errors or logs needed for this one.

Environment (please complete the following information):

  • iOS? Version: ...
  • Android? Version: ...
  • Real Device? Which?: ...
  • Emulator/Simulator? Which?: ...
  • Version of barcode_scan
  • Output of flutter --version:
Flutter ...

Additional context
Add any other context about the problem here.

[Bug] 'flashMode' was deprecated in iOS 10.0

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
Deprecation warning when building the app.

To Reproduce
Steps to reproduce the behavior:

  1. Open in Xcode
  2. Product | Build

Expected behavior
Expected no issues

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
If applicable, add the verbose output of flutter run.

Environment (please complete the following information):

  • iOS? Version: 12+
  • Version of barcode_scan: 4.1.4
  • Output of flutter --version:
Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f4abaa0735 (9 weeks ago) • 2021-07-01 12:46:11 -0700
Engine • revision 241c87ad80
Tools • Dart 2.13.4

Additional context
Only a warning but will limit the lifespan of apps using the package

Crash Release Android x86

This bug is reproducible when you generate the app using in release mode and you open it in an x86 or arm32 emulator

If you are having issues opening an app on your x86 or arm32 emulator, you may be seeing the following error message: "{AppName} consistently crashes". This may be caused by the fact that Flutter does not support x86 files, as mentioned in this link: https://docs.flutter.dev/deployment/android#what-are-the-supported-target-architectures. According to the documentation, Flutter currently does not offer support for generating x86 files for Android (see Issue 9253).

This can be a particularly problematic when you are trying to use packages that depend on resources such as the camera or MLKit. To resolve this issue, you can edit the 'build.grandle' file in the 'app' folder and add the following lines to prevent the generation of x86 files:

   defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86_64'
        }
    }

This should help resolve the issue and allow you to open the app on the emulator without errors. It is important to remember that Flutter currently only supports the armeabi-v7a (ARM 32-bit), arm64-v8a (ARM 64-bit), and x86-64 (x86 64-bit) target architectures. Therefore, when editing the 'build.grandle' file, it is important to ensure that you are only including these architectures.

[Bug] Execution failed for task ':barcode_scan2:compileDebugKotlin'.

Describe the bug
The project throws an error after upgrading to flutter 3.0

To Reproduce

  • Update to Flutter 3.0

Logs

e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ActivityHelper.kt: (16, 1): Class 'ActivityHelper' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ActivityHelper.kt: (71, 5): 'onRequestPermissionsResult' overrides nothing
e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ActivityHelper.kt: (81, 58): Type mismatch: inferred type is Array<CapturedType(out String)>? but Array<(out) String!> was expected
e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ActivityHelper.kt: (81, 71): Type mismatch: inferred type is IntArray? but IntArray was expected
e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ChannelHandler.kt: (64, 39): Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected
e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\RequestCameraPermissionHandler.kt: (8, 1): Class 'RequestCameraPermissionHandler' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\RequestCameraPermissionHandler.kt: (11, 5): 'onRequestPermissionsResult' overrides nothing

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':barcode_scan2:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details
Flutter 3.0

Additional context

Doctor summary (to see all details, run flutter doctor -v):
[] Flutter (Channel stable, 3.0.0, on Microsoft Windows [Version 10.0.22000.675], locale en-US)
[] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[] Android Studio (version 2021.2)
[] VS Code (version 1.67.0)
[] Connected device (3 available)
[] HTTP Host Availability

Possible cause

e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ActivityHelper.kt: (16, 1): Class 'ActivityHelper' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener

Access denied finding property "vendor.camera.aux.packagelist"

Describe the bug :
there's log : Access denied finding property "vendor.camera.aux.packagelist", but camera and scanning work nicely

To Reproduce
Steps to reproduce the behavior:

Expected behavior
There's should be no log, it's just annoying

Screenshots
Capture

Logs
Access denied finding property "vendor.camera.aux.packagelist"

Environment (please complete the following information):
Android 11
Real Device: VIVO V19
Version of barcode_scan: 4.1.3

Additional context
None.

[Feature Request] Continuous reading mode

Is your feature request related to a problem? Please describe.
The original issue is: mintware-de/flutter_barcode_reader#147
I want to read multiple barcodes without closing the camera each time.

Additional context
I'm using ai_barcode package which doesn't close the camera automatically and provides a callback called when a barcode is read, but this package isn't null-safety yet.
https://pub.dev/documentation/ai_barcode/latest/ai_barcode/ScannerController/ScannerController.html

[Feature Request] Limiting the Scan Zone, iOS

When scanning in iOS, a barcode is already recognized when it is in the camera image outside of the scan zone. If you have multiple barcodes close to each other, it is not very easy to scan a barcode.

It would be helpful if barcodes are only recognized inside the scan zone, which could be solved by scanRect see MTBBarcodeScanner:

https://github.com/mikebuss/MTBBarcodeScanner#limiting-the-scan-zone

Thanks in advance for a reply. If you need more information or if there is another way to solve this, please let me know.

Not opening camera feed after allowing camera permission

Not opening camera feed screen after allowing camera permission, below is my code:

    Future _scanQR(String sponsorId,BuildContext context) async {
    try {
    ScanResult qrResult = await BarcodeScanner.scan();

  Map valueMap = jsonDecode(qrResult.rawContent);
  result = valueMap[ParameterConstants.sponsorId];

  if (result == sponsorId) {
    SponsorsRepository().qrScanned(sponsorId);

    showQrCodeScannedSuccessfully(context: context);
  } else {
    showQrCodeScannedError(context: context);
  }
}
on PlatformException catch (ex) {
  if (ex.code == BarcodeScanner.cameraAccessDenied) {
    showNoCameraPermissionError(context: context);
  } else {
    result = "Unknown Error $ex";
    print("result:$result");
  }
} on FormatException {
  result = "You pressed the back button before scanning anything";
  print("result:$result");
} catch (ex) {
  showQrCodeScannedError(context: context);
}
}

Unable to resume activity in release mode Java.lang.NoSuchMethodException

Describe the bug
I published an app in play store and throw an java.lang.NoSuchMethodException. I attached the trace in Logs section
The issue also happens when you run the app with the follow command:
flutter run --release
I took the example of library and the issue is the same.

To Reproduce
Steps to reproduce the behavior:
The method BarcodeScanner.scan(); throws an exception in production.

  void _scanQR(BuildContext context) async {
    ScanResult? scanResult;

    try {
      scanResult = await BarcodeScanner.scan();
    } on PlatformException catch (e) {
      if (e.code == BarcodeScanner.cameraAccessDenied) {
        Fluttertoast.showToast(msg: 'The camera access was denied');
      } else {
        ...
      }
    } catch (e) {
      ...
    }

    if (scanResult != null && scanResult.rawContent != '') {
     ...
    }
  }

Expected behavior
The call to scan should return and valid ScanResult

Logs

java.lang.RuntimeException: Unable to resume activity {###.####.###/de.mintware.barcode_scan.BarcodeScannerActivity}: java.lang.RuntimeException: java.lang.NoSuchMethodException: c.b.d.e.values []
java.lang.RuntimeException: 
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4504)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4536)
  at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2104)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:236)
  at android.app.ActivityThread.main (ActivityThread.java:7861)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:600)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)
Caused by: java.lang.RuntimeException: 
  at java.lang.Enum.enumValues (Enum.java:270)
  at java.lang.Enum.access$000 (Enum.java:61)
  at java.lang.Enum$1.create (Enum.java:277)
  at java.lang.Enum$1.create (Enum.java:275)
  at libcore.util.BasicLruCache.get (BasicLruCache.java:63)
  at java.lang.Enum.getSharedConstants (Enum.java:289)
  at java.lang.Class.getEnumConstantsShared (Class.java:2428)
  at java.util.EnumMap.getKeyUniverse (EnumMap.java:755)
  at java.util.EnumMap.<init> (EnumMap.java:138)
  at me.dm7.barcodescanner.zxing.ZXingScannerView.o (ZXingScannerView.java:4)
  at me.dm7.barcodescanner.zxing.ZXingScannerView.<init> (ZXingScannerView.java:3)
  at de.mintware.barcode_scan.ZXingAutofocusScannerView.<init> (ZXingAutofocusScannerView.java:5)
  at de.mintware.barcode_scan.BarcodeScannerActivity.setupScannerView (BarcodeScannerActivity.java)
  at de.mintware.barcode_scan.BarcodeScannerActivity.onResume (BarcodeScannerActivity.java)
  at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1457)
  at android.app.Activity.performResume (Activity.java:8264)
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4494)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4536)
  at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2104)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:236)
  at android.app.ActivityThread.main (ActivityThread.java:7861)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:600)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)
Caused by: java.lang.NoSuchMethodException: 
  at java.lang.Class.getMethod (Class.java:2072)
  at java.lang.Class.getDeclaredMethod (Class.java:2050)
  at java.lang.Enum.enumValues (Enum.java:267)
  at java.lang.Enum.access$000 (Enum.java:61)
  at java.lang.Enum$1.create (Enum.java:277)
  at java.lang.Enum$1.create (Enum.java:275)
  at libcore.util.BasicLruCache.get (BasicLruCache.java:63)
  at java.lang.Enum.getSharedConstants (Enum.java:289)
  at java.lang.Class.getEnumConstantsShared (Class.java:2428)
  at java.util.EnumMap.getKeyUniverse (EnumMap.java:755)
  at java.util.EnumMap.<init> (EnumMap.java:138)
  at me.dm7.barcodescanner.zxing.ZXingScannerView.o (ZXingScannerView.java:4)
  at me.dm7.barcodescanner.zxing.ZXingScannerView.<init> (ZXingScannerView.java:3)
  at de.mintware.barcode_scan.ZXingAutofocusScannerView.<init> (ZXingAutofocusScannerView.java:5)
  at de.mintware.barcode_scan.BarcodeScannerActivity.setupScannerView (BarcodeScannerActivity.java)
  at de.mintware.barcode_scan.BarcodeScannerActivity.onResume (BarcodeScannerActivity.java)
  at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1457)
  at android.app.Activity.performResume (Activity.java:8264)
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4494)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4536)
  at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2104)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:236)
  at android.app.ActivityThread.main (ActivityThread.java:7861)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:600)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)

Environment (please complete the following information):

  • iOS? Version: ...
  • Android? Version: Android 11 (SDK 30)
  • Real Device? Which?: Redmi Note 9 Pro
  • Emulator/Simulator? Which?: ...
  • Version of barcode_scan: ^4.2.0
  • Output of flutter --version:
    Flutter 2.5.2 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 3595343e20 (8 weeks ago) • 2021-09-30 12:58:18 -0700
    Engine • revision 6ac856380f
    Tools • Dart 2.14.3

Additional context
I've worked with this library in test and it works, i found the problem in the production app in the Play Store.

[Feature Request] Get raw bytes when reading DataMatrix format

I am reading a DataMatrix file and the result is stored in ScanResult as a String field called rawContent. However, the data stored in the DataMatrix is data compressed with zip.

I need to get the exact raw bytes stored in DataMatrix and not a String that has probably been encoded/decoded from the raw bytes and has been altered.

Can you help?

Platform libraries are abandoned

I was posing a question about this flutter plugin and its longevity. As a developer I would like to use code that is actively maintained, because of bugs.
That is a primary concern in the android ecosystem, where every 12 months a new major version of the os with breaking changes rolls out (the last two, android 12 and 11, introduces different breaking changes).
I noticed that both the android and the ios libraries used by this plugin are abandoned.
What are your plans about this? Do you think to migrate to another library with the same functionalities?
This library is good, and thanks god someone continue to develop the original abandoned library and gave it nullsafety!
But I have this question and it's important for me to know the answer.

[Bug] Release App Crashed

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
java.lang.IllegalAccessError: Illegal class access: 'androidx.appcompat.widget.ContentFrameLayout' attempting to access 'androidx.appcompat.app.u' (declaration of 'androidx.appcompat.widget.ContentFrameLayout' appears in /data/app/~~Ic1pW95wWnDuOe5V4CR2FQ==/com.addpix.inventrocloud-OCVG4ZkOa_H7IFOZlGLdkw==/base.apk)
E/AndroidRuntime(25204): at androidx.appcompat.widget.ContentFrameLayout.onAttachedToWindow(Unknown Source:7)
E/AndroidRuntime(25204): at android.view.View.dispatchAttachedToWindow(View.java:22010)
E/AndroidRuntime(25204): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4291)
E/AndroidRuntime(25204): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4298)
E/AndroidRuntime(25204): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4298)
E/AndroidRuntime(25204): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4298)
E/AndroidRuntime(25204): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4298)
E/AndroidRuntime(25204): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3135)
E/AndroidRuntime(25204): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2618)
E/AndroidRuntime(25204): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9971)
E/AndroidRuntime(25204): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1010)
E/AndroidRuntime(25204): at android.view.Choreographer.doCallbacks(Choreographer.java:809)
E/AndroidRuntime(25204): at android.view.Choreographer.doFrame(Choreographer.java:744)
E/AndroidRuntime(25204): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:995)
E/AndroidRuntime(25204): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(25204): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(25204): at android.os.Looper.loop(Looper.java:246)
E/AndroidRuntime(25204): at android.app.ActivityThread.main(ActivityThread.java:8633)
E/AndroidRuntime(25204): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(25204): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
E/AndroidRuntime(25204): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

Unable to change ActionBar and Status bar colors

My flutter app has diiferent color theme, but whenever I open scanner screen, ActionBar and Status bar appears in black color.

How to change ActionBar and Status bar colors of Scanner Screen ?

Please check below attached screenshot.

barcode_scanner

This is the only problem I am facing.
Thanks for your awesome plugin.

[Bug] AutoFocus does not work properly

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
The autofocus doesn't work even though it is set to true

To Reproduce
Steps to reproduce the behavior:

  1. Run the barcode scanner when the camera is far away from an object (thus when it starts it is focussed for far away)
  2. Try to scan a barcode close up
  3. The camera doesn't change its focus to be able to scan the barcode closeby

Expected behavior
The camera should adjust its focus whenever an object comes close

Screenshots
None

Logs
None

Environment (please complete the following information):

  • Android? Version: 11
  • Real Device? Samsung galaxy a70
  • Version of barcode_scan: 4.1.3

Additional context
None

[Bug] App crashing when instructing to scan

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
Unable to scan for QR code. As soon as I click on the scan button, the app crashes. Crashing on Android. Don't know about IOS.

To Reproduce
Steps to reproduce the behavior:
Source code snippet:

  _scanQrCode() async {
    final ScanResult scanResult = await BarcodeScanner.scan();
    if(scanResult.type == ResultType.Barcode && scanResult.format == BarcodeFormat.qr) {
      _configureQRData(scanResult.rawContent.trim());
    } else {
      _showToast(locale.msgQrFail);
    }
  }

Expected behavior
On click scan, the scanning screen should be shown for scanning QR code.

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
D/AndroidRuntime(14501): Shutting down VM
E/AndroidRuntime(14501): FATAL EXCEPTION: main
E/AndroidRuntime(14501): Process: in.corp.myapp.debug, PID: 14501
E/AndroidRuntime(14501): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/zxing/BarcodeFormat;
E/AndroidRuntime(14501): at de.mintware.barcode_scan.BarcodeScannerActivity.(BarcodeScannerActivity.kt:33)
E/AndroidRuntime(14501): at java.lang.Class.newInstance(Native Method)
E/AndroidRuntime(14501): at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
E/AndroidRuntime(14501): at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
E/AndroidRuntime(14501): at android.app.Instrumentation.newActivity(Instrumentation.java:1273)
E/AndroidRuntime(14501): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3520)
E/AndroidRuntime(14501): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3780)
E/AndroidRuntime(14501): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
E/AndroidRuntime(14501): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(14501): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(14501): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2251)
E/AndroidRuntime(14501): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(14501): at android.os.Looper.loop(Looper.java:233)
E/AndroidRuntime(14501): at android.app.ActivityThread.main(ActivityThread.java:8035)
E/AndroidRuntime(14501): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(14501): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
E/AndroidRuntime(14501): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
E/AndroidRuntime(14501): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.zxing.BarcodeFormat" on path: DexPathList[[zip file "/data/app/~~dczBNEhshJBc0efpkRNGYA==/in.corp.myapp.debug-_RR2_ZvqM6LXbr6gl51a9Q==/base.apk"],nativeLibraryDirectories=[/data/app/~~dczBNEhshJBc0efpkRNGYA==/in.corp.myapp.debug-_RR2_ZvqM6LXbr6gl51a9Q==/lib/arm64, /data/app/~~dczBNEhshJBc0efpkRNGYA==/in.corp.myapp.debug-_RR2_ZvqM6LXbr6gl51a9Q==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
E/AndroidRuntime(14501): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
E/AndroidRuntime(14501): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime(14501): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

Environment (please complete the following information):

  • iOS? Version: N/A
  • Android? Version: 11
  • Real Device? Which?: OnePlus 9 Pro
  • Emulator/Simulator? Which?: N/A
  • Version of barcode_scan: 4.2.0
  • Output of flutter --version:
Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7e9793dee1 (3 weeks ago) • 2022-03-02 11:23:12 -0600
Engine • revision bd539267b4
Tools • Dart 2.16.1 • DevTools 2.9.2

Additional context
No more info. available.

Remove scanner screen action bar

Hi,

I would like to remove the action bar on the scanner screen or change the title. Is it possible? I try to change the title but I can't figure out how to do it.

Screenshot_20220606-191746_1

Java RuntimeException: Reply already submitted

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
The following exception has occured in producion. Got it in Sentry.

Failure delivering result ResultInfo{who=null, request=100, result=-1, data=Intent { (has extras) }} to activity {ru.carmelrus.pdi/ru.carmelrus.pdi.MainActivity}: java.lang.IllegalStateException: Reply already submitted

To Reproduce
Steps to reproduce the behavior:
Not sure

Expected behavior

Screenshots
1625565743786
1625565836668
1625565915515

Logs
sentry-log.json.txt
Here is the issue log from Sentry.

p.s.
Could not load it here as .json, so it is .json.txt

Environment (please complete the following information):

  • Android? Version: 9
  • Real Device? Which?: Samsung SM-T395
  • Version of barcode_scan ^4.1.3
  • Output of flutter --version:
Flutter 2.2.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d79295af24 (4 weeks ago) • 2021-06-11 08:56:01 -0700
Engine • revision 91c9fc8fe0
Tools • Dart 2.13.3

Additional context

[Bug] Android build failed on Apple Silicon M1

Describe the bug
Android build fails on Apple Silicon M1

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Android Studio'
  2. Click on 'build button'
  3. Scroll down to 'build Output'
  4. See error:
> Task :barcode_scan2:generateDebugProto FAILED

Execution failed for task ':barcode_scan2:generateDebugProto'.
> Could not resolve all files for configuration ':barcode_scan2:protobufToolsLocator_protoc'.
   > Could not find protoc-3.11.0-osx-aarch_64.exe (com.google.protobuf:protoc:3.11.0).
     Searched in the following locations:
         https://repo.maven.apache.org/maven2/com/google/protobuf/protoc/3.11.0/protoc-3.11.0-osx-aarch_64.exe

Expected behavior
Build project successfully.

Screenshots
image
image

Logs

If applicable, add the verbose output of `flutter run`

Multiple devices found:
sdk gphone arm64 (mobile)  • emulator-5554                        • android-arm64 • Android 11 (API 30)
(emulator)
iPhone 12 Pro Max (mobile) • 86C2CFF0-AC1B-4CCF-BD4C-5F8365E480A3 • ios           •
com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
[1]: sdk gphone arm64 (emulator-5554)
[2]: iPhone 12 Pro Max (86C2CFF0-AC1B-4CCF-BD4C-5F8365E480A3)
Please choose one (To quit, press "q/Q"): 1
Using hardware rendering with device sdk gphone arm64. If you notice graphics artifacts, consider
enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on sdk gphone arm64 in debug mode...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Execution failed for task ':barcode_scan2:generateDebugProto'.          
> Could not resolve all files for configuration ':barcode_scan2:protobufToolsLocator_protoc'.
   > Could not find protoc-3.11.0-osx-aarch_64.exe (com.google.protobuf:protoc:3.11.0).
     Searched in the following locations:                               
         https://repo.maven.apache.org/maven2/com/google/protobuf/protoc/3.11.0/protoc-3.11.0-osx-aarch_64.exe
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                        
* Get more help at https://help.gradle.org                              
                                                                        
BUILD FAILED in 23s                                                     
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        23.8s
Exception: Gradle task assembleDebug failed with exit code 1

Environment (please complete the following information):

  • [-] iOS? Version: ...
  • [+] Android? Version: 11 API 30
  • [+] Real Device? Which?: Samsung Galaxy A32
  • [+] Emulator/Simulator? Which?: Pixel 2
  • Version of barcode_scan 4.1.3
  • Output of flutter --version:
Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f4abaa0735 (3 weeks ago) • 2021-07-01 12:46:11 -0700
Engine • revision 241c87ad80
Tools • Dart 2.13.4

Additional context
Add any other context about the problem here.

Compatible with web

NOw with flutter 2 the web is and readable version, is there any development to add compatibility with the web?

[Bug] crash ZXingAutofocusScannerView.java: getParameters failed (empty parameters)

Describe the bug
Only one time, the release version in the play store of the app has crashed.

To Reproduce
Can't reproduce. The error comes from crashlytics

Logs
Stacktrace:

Fatal Exception: java.lang.RuntimeException: getParameters failed (empty parameters)
       at android.hardware.Camera.native_getParameters(Camera.java)
       at android.hardware.Camera.getParameters(Camera.java:1910)
       at de.mintware.barcode_scan.ZXingAutofocusScannerView.setupCameraPreview(ZXingAutofocusScannerView.java)
       at me.dm7.barcodescanner.core.CameraHandlerThread$1$1.run(CameraHandlerThread.java)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6138)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)

Environment:

  • Android: 7.1.2
  • Real device: Samsung Galaxy S8+
  • Version of barcode_scan: 4.1.4
  • Output of flutter --version:
Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f4abaa0735 (3 months ago) • 2021-07-01 12:46:11 -0700
Engine • revision 241c87ad80
Tools • Dart 2.13.4

Edit:
This bug appears some times in crashlytics

[Bug] Consider UPCA as EAN13

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
When you scan a 12-digit UPC_A barcode, Codescan recoginaze it as EAN13 and pad a '0' at the begin of rawContent.

For example:
UPC_A 096619663712, it will be returned as 0096619663712 in the format of EAN13.

To Reproduce
Scan

Expected behavior
return 096619663712 instead of 0096619663712

Screenshots
If applicable, add screenshots to help explain your problem.
159

Logs
If applicable, add the verbose output of flutter run.

Environment (please complete the following information):

  • iOS? Version: ...
  • Android? Version: ...
  • Real Device? Which?: ...
  • Emulator/Simulator? Which?: ...
  • Version of barcode_scan
  • Output of flutter --version:
Flutter ...

Additional context
Add any other context about the problem here.

[Feature Request] Please release a version with a later version of kotlin

Is your feature request related to a problem? Please describe.
For a flutter project with higher kotlin version, such as 1.7.21, and

flutter build apk
Building with sound null safety
FAILURE: Build failed with an exception.

  • What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
    The following dependencies do not satisfy the required version:
    project ':barcode_scan2' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61

Describe the solution you'd like
If it's possible to get barcode_scan2 version with kotlin gradle > 1.5.20

Describe alternatives you've considered
I don't want to degrade my project's kotlin, so I have to stay with a few compatibility warnings at this time without upgrading classpath and distributionUrl.

Additional context
Thanks for the plugin!

[Bug] Error in release mode

Describe the bug
When launching the scanner in an app built in release mode the scanner is not shown. Look below for the logs.
There seems to be some problem with

Field aspectTolerance_ for de.mintware.barcode_scan.d not found. Known fields are [private double de.mintware.barcode_scan.d.f, private boolean de.mintware.barcode_scan.d.g, private static final de.mintware.barcode_scan.d de.mintware.barcode_scan.d.h, private static volatile e.a.b.a1 de.mintware.barcode_scan.d.i]

To Reproduce
Steps to reproduce the behavior:

  1. in example/ exec flutter run --release
  2. click on the scan button in the action bar

Expected behavior
The scanner should be shown

Logs

example % flutter run --release
Launching lib/main.dart on JSN L21 in release mode...
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      64,2s
✓ Built build/app/outputs/flutter-apk/app-release.apk (7.7MB).
Installing build/app/outputs/flutter-apk/app.apk...              2.465ms

Flutter run key commands.
h Repeat this help message.
c Clear the screen
q Quit (terminate the application on the device).
E/flutter (18978): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(scan, null, java.lang.reflect.InvocationTargetException
E/flutter (18978): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter (18978): 	at de.mintware.barcode_scan.ChannelHandler.c(Unknown Source:50)
E/flutter (18978): 	at f.a.c.a.j$a.a(Unknown Source:17)
E/flutter (18978): 	at io.flutter.embedding.engine.e.b.d(Unknown Source:57)
E/flutter (18978): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(Unknown Source:4)
E/flutter (18978): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (18978): 	at android.os.MessageQueue.next(MessageQueue.java:363)
E/flutter (18978): 	at android.os.Looper.loop(Looper.java:173)
E/flutter (18978): 	at android.app.ActivityThread.main(ActivityThread.java:8178)
E/flutter (18978): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter (18978): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
E/flutter (18978): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
E/flutter (18978): Caused by: java.lang.RuntimeException: Field aspectTolerance_ for de.mintware.barcode_scan.d not found. Known fields are [private double de.mintware.barcode_scan.d.f, private boolean de.mintware.barcode_scan.d.g, private static final de.mintware.barcode_scan.d de.mintware.barcode_scan.d.h, private static volatile e.a.b.a1 de.mintware.barcode_scan.d.i]
E/flutter (18978): 	at e.a.b.v0.n0(Unknown Source:72)
E/flutter (18978): 	at e.a.b.v0.T(Unknown Source:698)
E/flutter (18978): 	at e.a.b.v0.R(Unknown Source:12)
E/flutter (18978): 	at e.a.b.k0.e(Unknown Source:60)
E/flutter (18978): 	at e.a.b.k0.a(Unknown Source:49)
E/flutter (18978): 	at e.a.b.d1.d(Unknown Source:17)
E/flutter (18978): 	at e.a.b.d1.e(Unknown Source:4)
E/flutter (18978): 	at e.a.b.z.C(Unknown Source:4)
E/flutter (18978): 	at e.a.b.z$a.p(Unknown Source:9)
E/flutter (18978): 	at e.a.b.z$a.o(Unknown Source:0)
E/flutter (18978): 	at de.mintware.barcode_scan.f$b.z(Unknown Source:7)
E/flutter (18978): 	at de.mintware.barcode_scan.ChannelHandler.scan(Unknown Source:69)
E/flutter (18978): 	... 12 more
E/flutter (18978): , null)
E/flutter (18978): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581)
E/flutter (18978): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158)
E/flutter (18978): <asynchronous suspension>
E/flutter (18978): #2      BarcodeScanner._doScan (package:barcode_scan2/platform_wrapper.dart:74)
E/flutter (18978): <asynchronous suspension>
E/flutter (18978): #3      BarcodeScanner.scan.<anonymous closure> (package:barcode_scan2/platform_wrapper.dart:46)
E/flutter (18978): <asynchronous suspension>
E/flutter (18978): 

Environment (please complete the following information):

  • iOS? Version: ...
  • Android? Version: 10
  • Real Device? Which?: Huawei JSN L21
  • Emulator/Simulator? Which?: ...
  • Version of barcode_scan

v4.0.0

  • Output of flutter --version:
Flutter 2.0.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision adc687823a (10 giorni fa) • 2021-04-16 09:40:20 -0700
Engine • revision b09f014e96
Tools • Dart 2.12.3

[Feature Request] Not full screen camera preview

Hi,

Is there anyway to contain the camera preview in a container?

I mean, if I call the BarcodeScanner.scan() it will open up a full screen camera panel so as to scan the barcode but, I want to open a specifically sized container to fit the camera preview, like a dialog box, for some reasons.

If it is possible please let me know.

Many thanks.

[Bug] Buttons are not displayed on the camera screen

Hello, thank you for your work, the package is great!

Describe the bug

When opening the camera to scan a barcode, the camera screen appears in full screen without displaying any buttons. So it is not possible to cancel the scan or activate the flash.

To Reproduce

Steps to reproduce the behavior:

  1. Open the page example provided in the package.
  2. Click on the camera icon.
  3. The cancel and flash buttons do not appear.

Screenshots

Screenshot_20221109-170117

Environment (please complete the following information):

  • Android Version: 12
  • Real Device: Samsung S10+
  • Version of barcode_scan2: ^4.2.1
  • Output of flutter --version:
    Flutter 3.4.0-34.1.pre • channel beta • https://github.com/flutter/flutter.git
    Framework • revision 71520442d4 (5 weeks ago) • 2022-10-05 16:38:28 -0500
    Engine • revision db0cbb2145
    Tools • Dart 2.19.0 (build 2.19.0-255.2.beta) • DevTools 2.18.0

Not build with release mode[Bug]

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
Implement this plugin and just build release mode.
When i'm build with debug mode, everything is fine but in release mode it's not.

And error:

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':compileReleaseAidl'.

SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\flutter.pub-cache\hosted\pub.dartlang.org\barcode_scan2-4.1.3\android\local.properties'.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
If applicable, add the verbose output of flutter run.

Environment (please complete the following information):

  • iOS? Version: ...
  • Android? Version: ...
  • Real Device? Which?: ...
  • Emulator/Simulator? Which?: ...
  • Version of barcode_scan
  • Output of flutter --version:
Flutter ...

Additional context
Add any other context about the problem here.

[Bug] Update the IPHONEOS_DEPLOYMENT_TARGET to 9.0

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
/Users/builder/clone/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'MTBBarcodeScanner' from project 'Pods')

IOS 8.0 is no longer supported in latests projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.