0

I'm trying to implement a print to a bluetooth printer on an existing kotlin project. I am using an ESC/POS plugin with the steps given in https://github.com/anastaciocintra/escpos-coffee

The same code works on another project with a different configuration, I am unable to upgrade Gradle, SDK, JDK, and so on to the same version as the other project so I will need help in getting it to work on this project.

However, the project crashes whenever it tries to run the part of the code that comes from the package. I've traced the issue back to an import that seems to be missing "Cannot resolve symbol 'PrinterJob'".

Cannot resolve symbol 'PrinterJob'

In the photo attached, you can see that I do have the file as seen on the left under "Android Studio default JDK"/java.desktop/java/awt/print/PrinterJob

I'm speculating that it perhaps is looking into a different directory for "printer" because there are also java.base and also java.datatransfer on the left which does not have the PrinterJob.java in them.

The project's current configuration is as such:

        minSdkVersion 22
        targetSdkVersion 30
        versionCode 59
        compileSdkVersion 29
        android jdk version: 11.0.13
        buildscript {
            ext.kotlin_version = '1.3.72'
            repositories {
                jcenter()
                google()
            }
            dependencies {
                classpath 'com.android.tools.build:gradle:3.6.3'
                classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
            }
        }
kelsny
  • 23,009
  • 3
  • 19
  • 48
lyon kee
  • 1
  • 2
  • I highly doubt that the Android SDK contains classes from `java.awt.print.*`. For example, [the Android Package Index](https://developer.android.com/reference/packages) doesn't list it. – Mark Rotteveel Oct 07 '22 at 14:02

0 Answers0