JakeWharton / adb-event-mirror

Mirror the touch/key/button events of one device onto one or more other devices in real-time
Apache License 2.0
885 stars 43 forks source link

How to resolve dependency com.github.ajalt:clikt:2.8.0? #18

Closed perihanmirkelam closed 4 years ago

perihanmirkelam commented 4 years ago

Couldn't run the script by executing adb -s emulator-5554 shell getevent | kotlinc -script -- adb-event-mirror.main.kts 0498ad080405

Result:

error: unresolved reference: clikkotlinct (adb-event-mirror.main.kts:8:25) error: unresolved reference: multiple (adb-event-mirror.main.kts:27:4) error: unresolved reference: it (adb-event-mirror.main.kts:28:19) adb-event-mirror.main.kts:8:25: error: unresolved reference: clikkotlinct import com.github.ajalt.clikkotlinct.parameters.arguments.multiple ^ adb-event-mirror.main.kts:27:4: error: unresolved reference: multiple .multiple(true) ^ adb-event-mirror.main.kts:28:19: error: unresolved reference: it .transformAll { it.toSet() }

JakeWharton commented 4 years ago

Kotlin will download it automatically. What version of kotlinc are you using?

perihanmirkelam commented 4 years ago

info: kotlinc-jvm 1.3.72 (JRE 1.8.0_201-b09)

JakeWharton commented 4 years ago

You'll have to file a bug on JetBrains' YouTrack for Kotlin then. I have no control over this stage of the execution. The compiler is supposed to download and resolve the dependency before it ever reaches my code. Feel free to link the bug here so I can watch it and answer any questions from JetBrains as needed.

http://kotl.in/issue

JakeWharton commented 4 years ago

Also did you try running the script as an executable rather than manually invoking kotlinc?

perihanmirkelam commented 4 years ago

I got this error when running the script as an executable (I guess my env version is old)

/usr/bin/env: invalid option -- 'S'

I execute adb -s emulator-5554 shell getevent | ./adb-event-mirror.main.kts 0498ad080405 `

perihanmirkelam commented 4 years ago

I opened an issue on http://kotl.in/issue and tagged you. Thanks for your help.

JakeWharton commented 4 years ago

Are you on Ubuntu 18.04 or older?

For -S to work you need a newer coreutils which requires using a backports repository. There's details in here: https://github.com/JakeWharton/pidcat/issues/161

perihanmirkelam commented 4 years ago

I am on Mint 19 (based on Ubuntu 18.04). Updating coreutils is worked for me. No more dependency errors.

I want to share my experience, Trying on an emulator(Nexus 4 L) with a physical Nexus 4 L failed to mirror Trying on an emulator(Nexus 5 Q) with a physical Xiaomi Q failed to mirror Trying on an emulator(Nexus 5 Q) with an emulator(Nexus 5 P) succeed Trying on an emulator(Nexus 5 Q) with an emulator(Nexus 4 L) failed to mirror

I was hoping control my Nexus 4 remotely by the emulator with VPN. But it was nice to solve other issues. Thanks a lot!