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

demo application doesn't start on windows #2470

Closed
icrc-fdeniger opened this issue Mar 12, 2024 · 3 comments · Fixed by #2471
Closed

demo application doesn't start on windows #2470

icrc-fdeniger opened this issue Mar 12, 2024 · 3 comments · Fixed by #2471
Labels
effort:small Small effort - 2 days P1 High priority issue type:bug Something isn't working

Comments

@icrc-fdeniger
Copy link
Contributor

Describe the bug
can't start the demo application on Windows 10 with java 17

Relevant log:

java.io.FileNotFoundException: C:\WINDOWS\sqlite-3.36.0-d1d580cc-94e1-44dd-976b-9d0203cd82d9-sqlitejdbc.dll.lck (Access is denied)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:187)
	at org.sqlite.SQLiteJDBCLoader.extractAndLoadLibraryFile(SQLiteJDBCLoader.java:210)

I managed to let it work by migrating to kspid("com.google.devtools.ksp").version("1.9.21-1.0.16"):
https://github.com/google/android-fhir/compare/master...icrc-fdeniger:android-fhir:icrc-ok-pull-data?expand=1#diff-84cb3f8fc96e6909e77e32e7f45a90496814fd34fb2e9822056aea55aaa0e9e7

I believe the root is that I can open a file located the folder C:\WINDOWS ( not an admin)

@icrc-fdeniger icrc-fdeniger mentioned this issue Mar 12, 2024
7 tasks
@icrc-fdeniger icrc-fdeniger changed the title demo application doesn't start on winodw demo application doesn't start on windows Mar 12, 2024
@MJ1998
Copy link
Collaborator

MJ1998 commented Mar 12, 2024

Thanks for raising this @icrc-fdeniger

I think I know why ksp works and kapt does not. The overhead of kapt's stub generation process likely ran into permission problems in your non-admin setup. The exact folders it tried to write to are unknown, but they were probably system-protected. Ksp, on the other hand, directly processes kotlin symbols removing the need for stub generation entirely, perhaps bypassing the troublesome permission issues.

See more in Why KSP?
Also Android documentation recommends to migrate to ksp!

This seems to be a valid change and I think ksp is safe for room compiler.
Would you like to submit a PR for this ?

@MJ1998 MJ1998 added P1 High priority issue effort:small Small effort - 2 days type:bug Something isn't working labels Mar 12, 2024
@icrc-fdeniger
Copy link
Contributor Author

icrc-fdeniger commented Mar 13, 2024

Sure I tried with a first draft here :)
#2471

Not an expert with KSP, KAPT so I'm sure it should be polished. it's ok for me with this configuration but I will need to have feedbacks on this.
For instance for the ksp version (1.9.21-1.0.16). It seems it was the only config working for me.. but I can do more tests

@MJ1998
Copy link
Collaborator

MJ1998 commented Mar 14, 2024

Thanks and no worries @icrc-fdeniger. Have left some comments on your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:small Small effort - 2 days P1 High priority issue type:bug Something isn't working
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

2 participants