andresperezmelo / print_bluetooth_thermal

Plugin para enviar bytes sin procesar a la impresora solo por ahora para Android
Other
27 stars 35 forks source link

Cannot run flutter build apk --release using this package #12

Closed abdulrehmananwar closed 1 year ago

abdulrehmananwar commented 1 year ago

cannot build android application while using this package

andresperezmelo commented 1 year ago

Can you provide the error log in console?

abdulrehmananwar commented 1 year ago

FAILURE: Build failed with an exception.

BUILD FAILED in 3m 7s Running Gradle task 'assembleRelease'... 189.6s Gradle task assembleRelease failed with exit code 1

abdulrehmananwar commented 1 year ago

when i remove this package then i can build apk . i struck in this error from 2 days now finally resolve by remove this package.

andresperezmelo commented 1 year ago

The error is because the latest version of the plugin is updated with kotlin 1.8.0 and your project has kotlin 1.7.10

Go to the flutter project, and in the gradle in the path myproyect/android/build.gradle and in the line of code inside the buildscript there should be a variable ext.kotlin_version = '1.7.10' update a ext.kotlin_version = '1.8.0'

The final code should look like this

buildscript {
    ext.kotlin_version = '1.8.0' //here
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.1.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" //here
    }
}

Or you can use an older version of the plugin

abdulrehmananwar commented 1 year ago

Issue Resoved by doing this