mintware-de / flutter_barcode_reader

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

incompatibility between flutter_barcode_reader and location plugin for android #139

Closed rlazom closed 4 years ago

rlazom commented 5 years ago

After updating the plug-in to version 1.0.0 and integrating the location plug-in into my flutter application, I had some problems to compile the application on Android, it crashed every time I tried to compile. After a week of searching and mixing some of the answers I found, this was the one that finally worked:

Please add this modifications to the instalation guide:

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

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

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

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
...

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
...
}

IMPORTANT: The Kotlin plugin (kotlin-android) must be below the android plugin (com.android.application)

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

...
barcode_scan: ^1.0.0
marcos930807 commented 4 years ago

Thanks!!!