Build Failure: receiver type mismatch when compiling Rustdesk for Android #2238

Closed
opened 2026-02-21 00:16:53 -05:00 by deekerman · 1 comment
Owner

Originally created by @aakashkhochare on GitHub (Oct 25, 2023).

Bug Description

When I try to build rustdesk 1.2.1 for android, the build fails at flutter build apk with the following error:

e: /home/akhoc/rustdesk_source/rustdesk-1.2.1/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt: (343, 62): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: public inline fun <T : Closeable?, R> TypeVariable(T).use(block: (TypeVariable(T)) -> TypeVariable(R)): TypeVariable(R) defined in kotlin.io

The error seems to be at imageReader.acquireLatestImage().use

How to Reproduce

Download rustdesk 1.2.1 source code from the releases.

Follow the build guide for android link

Expected Behavior

The build to finish successfully and an android apk file for installation

Operating system(s) on local side and remote side

Android -> Linux

RustDesk Version(s) on local side and remote side

1.2.1 -> 1.2.1

Screenshots

errorrustdesk

Additional Context

While I am reporting this error for 1.2.1, I had the same error with 1.2.2

Originally created by @aakashkhochare on GitHub (Oct 25, 2023). ### Bug Description When I try to build rustdesk 1.2.1 for android, the build fails at flutter build apk with the following error: `e: /home/akhoc/rustdesk_source/rustdesk-1.2.1/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt: (343, 62): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: public inline fun <T : Closeable?, R> TypeVariable(T).use(block: (TypeVariable(T)) -> TypeVariable(R)): TypeVariable(R) defined in kotlin.io ` The error seems to be at `imageReader.acquireLatestImage().use` ### How to Reproduce Download rustdesk 1.2.1 source code from the releases. Follow the build guide for android [link](https://rustdesk.com/docs/en/dev/build/android/) ### Expected Behavior The build to finish successfully and an android apk file for installation ### Operating system(s) on local side and remote side Android -> Linux ### RustDesk Version(s) on local side and remote side 1.2.1 -> 1.2.1 ### Screenshots ![errorrustdesk](https://github.com/rustdesk/rustdesk/assets/20793471/169f4f1b-1bf1-4beb-b332-3549045fb682) ### Additional Context While I am reporting this error for 1.2.1, I had the same error with 1.2.2
deekerman 2026-02-21 00:16:53 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@rustdesk commented on GitHub (Oct 25, 2023):

#763

@rustdesk commented on GitHub (Oct 25, 2023): #763
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rustdesk-rustdesk#2238
No description provided.