Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks fail when project path contains space on Windows #362

Closed
connyduck opened this issue Jun 12, 2020 · 5 comments · Fixed by #390
Closed

Tasks fail when project path contains space on Windows #362

connyduck opened this issue Jun 12, 2020 · 5 comments · Fixed by #390
Assignees
Labels

Comments

@connyduck
Copy link

> Task :ktlintKotlinScriptCheck FAILED
1 actionable task: 1 executed
Exception in thread "main" java.io.FileNotFoundException: C:\Users\Conny (Access is denied)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:270)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
	at java.io.PrintStream.<init>(PrintStream.java:248)
	at com.pinterest.ktlint.KtlintCommandLine.toReporter(Main.kt:414)
	at com.pinterest.ktlint.KtlintCommandLine.loadReporter(Main.kt:392)
	at com.pinterest.ktlint.KtlintCommandLine.run(Main.kt:222)
	at com.pinterest.ktlint.Main.main(Main.kt:61)

The full path to the project would be C:\Users\Conny Duck\Android\projectname but seems like the space is not handled correctly. I am using version 9.2.1.

@JLLeitschuh
Copy link
Owner

That sounds like it's a bug in Ktlint proper not this plugin. @Tapchicoma do you agree?

@Tapchicoma
Copy link
Collaborator

could be a plugin issue as well, need some check.

@connyduck could you drop here ktlint args generated file? Usually it is located in build/ktlint/*.args

@connyduck
Copy link
Author

Here you go

ktlintKotlinScriptCheck.args

--reporter=plain
--color
--reporter=plain,output=C:\Users\Conny Duck\Android\projectname\build\reports\ktlint\ktlintKotlinScriptCheck.txt
build.gradle.kts
settings.gradle.kts

@Tapchicoma
Copy link
Collaborator

Looking at reporter line, I think plugin forgot to escape spaces in path, so most probably it is not just Windows specific issue.

@FrankHossfeld
Copy link

This problem also exists on macOS:

> Task :buildSrc:ktlintKotlinScriptCheck FAILED
Exception in thread "main" java.io.FileNotFoundException: /Volumes/El (Operation not permitted)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
    at java.io.PrintStream.<init>(PrintStream.java:248)
    at com.pinterest.ktlint.KtlintCommandLine.toReporter(Main.kt:414)
    at com.pinterest.ktlint.KtlintCommandLine.loadReporter(Main.kt:392)
    at com.pinterest.ktlint.KtlintCommandLine.run(Main.kt:222)
    at com.pinterest.ktlint.Main.main(Main.kt:61)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants