pedrovgs / Shot

Screenshot testing library for Android
Apache License 2.0
1.19k stars 116 forks source link

Failing with error: Unable to make public void sun.nio.ch.ChannelInputStream.close() #311

Closed basimsherif closed 2 years ago

basimsherif commented 2 years ago

Expected behaviour

It should successfully execute and generate screenshots

Actual behaviour

Failing with error:

Task :app:debugDownloadScreenshots ⬇️ Pulling screenshots from your connected devices! Shot ADB warning: We could not pull screenshots from folder: /storage/emulated/0/Download/screenshots/com.example.espressoworkshop.test/screenshots-compose-default/ Shot ADB warning: rm: /storage/emulated/0/Download/screenshots/com.example.espressoworkshop.test/screenshots-compose-default/: No such file or directory

Task :app:debugExecuteScreenshotTests FAILED 💾 Saving screenshots.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:debugExecuteScreenshotTests'.

    Unable to make public void sun.nio.ch.ChannelInputStream.close() throws java.io.IOException accessible: module java.base does not "exports sun.nio.ch" to unnamed module @6b8617c7

Steps to reproduce

Execute command ./gradlew executeScreenshotTests -Precord

Version of the library

Lib version: 5.14.1 Java version: 1.8 Emulator version: API 30

basimsherif commented 2 years ago

This happened because I was using java version 17 on my mac. Installed version 11 and this got resolved.