mintware-de / flutter_barcode_reader

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

Error Kotlin-Gradle version #70

Closed Deizo closed 4 years ago

Deizo commented 5 years ago

Please, anybody can help me?

I've tried to use barcode_scan plugin in my Flutter app (Flutter v. 1.0 / IDE's: Android Studio and VS Code), but running the app raise this error:

Configure project :barcode_scan
WARNING: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.0.

Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

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 a stack trace.

FAILURE: Build failed with an exception.
What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
The following dependencies do not satisfy the required version:
project ':barcode_scan' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.51

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.
Sakhawat238 commented 5 years ago

Did any one solve this problem? currently I am facing the same issues ..zzz

FitzReaper commented 5 years ago

I got the same issue and it seems to be solved by changing you android/build.gradle I had to downgrade from classpath 'com.android.tools.build:gradle:3.3.1' to classpath 'com.android.tools.build:gradle:3.2.1' but other issues came in...

buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.2.0'
    }
}

Now, the code is compiling, it's running well on iOS but keeps stopping at launching on Android devices and emulators.

fritz-playmaker commented 5 years ago

Same issue here. Waiting for some feedback from the moderators. What gradle build should we combine with kotlin's latest version to ensure a successful build. Hope this can be answered ASAP

fritz-playmaker commented 5 years ago

Any updates?

fritz-playmaker commented 5 years ago

Check these steps. It worked for me

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