Skip to content

Android version won't compile #9

@patratacus

Description

@patratacus

Hello, this is an excellent USB HID library. I had no problems getting the example code to run on Windows and MacOS. I have issue with iOS not being able to load in the emulator but maybe that's a problem with the emulator. Unfortunately, the Android version couldn't get past the assembly process. This is the error I have:

e: C:...\flutter.pub-cache\hosted\pub.dartlang.org\hid_android-0.1.3\android\src\main\kotlin\com\rustui\hid_android\HidAndroidPlugin.kt: (72, 32): Expecting ')'
e: C:...\flutter.pub-cache\hosted\pub.dartlang.org\hid_android-0.1.3\android\src\main\kotlin\com\rustui\hid_android\HidAndroidPlugin.kt: (72, 32): Unexpected tokens (use ';' to separate expressions on the same line)
e: C:...\flutter.pub-cache\hosted\pub.dartlang.org\hid_android-0.1.3\android\src\main\kotlin\com\rustui\hid_android\HidAndroidPlugin.kt: (89, 55): Unresolved reference: i
e: C:...\flutter.pub-cache\hosted\pub.dartlang.org\hid_android-0.1.3\android\src\main\kotlin\com\rustui\hid_android\HidAndroidPlugin.kt: (89, 70): Unresolved reference: j

Looking at HIDAndroidPlugin.kt, I'm not sure why it's expecting another ')' since it didn't seem to miss one. The later errors on line 89 is actually interesting since the variable i and j are being called but I don't see that declared anywhere. I'm still ned to Kotlin so I'm not sure whether an undeclared variable could be used but I assume not.

"read" -> {
if (connection != null) {
val length: Int = call.argument("length")!!
val duration: Int = call.argument("duration")!!
Thread {
kotlin.run {
val array = ByteArray(length)
connection!!.bulkTransfer(
device!!.getInterface(i).getEndpoint(j),
array,
length,
duration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions