mintware-de / flutter_barcode_reader

A flutter plugin for reading 2D barcodes and QR codes.
MIT License
628 stars 462 forks source link

build error on android platform #79

Closed RommiPlus closed 5 years ago

RommiPlus commented 5 years ago

I have cloned this project and run with android studio on android phone, but it can not build success. Error as below:

* Error running Gradle:
ProcessException: Process "/Users/shentao/flutter_barcode_reader/example/android/gradlew" exited abnormally:
Finished with error: Please review your Gradle project setup in the android/ folder.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':barcode_scan'.
> Failed to notify project evaluation listener.
   > java.lang.AbstractMethodError (no error message)

* 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 2s
  Command: /Users/shentao/flutter_barcode_reader/example/android/gradlew app:properties

Anyone has problem like me? Please help me. Thanks.

Laysros commented 5 years ago

the same problem to me.

fritz-playmaker commented 5 years ago

Check these steps. It worked for me

https://github.com/apptreesoftware/flutter_barcode_reader/issues/71#issuecomment-468291746

sofpanos commented 5 years ago

I had the same issue, I fixed this by changing some lines in build.gradle files. I came to this solution from https://kotlinlang.org/docs/reference/using-gradle.html project level build.gradle:

//this has to do with kotlin androidX support, Kotlin supports androidX from version 1.3.x //change this line //ext.kotlin_version = '1.2.31' //to ext.kotlin_version = '1.3.30'

app level build.gradle: //Change this line //implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" //to implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

Hope it helps you too.

Glup3 commented 5 years ago

This helped me: https://github.com/flutter/flutter/issues/27254#issuecomment-468526704

I solved it by upgrading my gradle dependency in the android/build.gradle file: classpath 'com.android.tools.build:gradle:3.3.1' (I was previously on version 3.2.1)

RommiPlus commented 5 years ago

for scan qr code, finally i use plugin to solve it. Thanks all.