Android targetSDK and android kotlin source folder
See original GitHub issueI made a fresh new project with the latest release using the Kotlin language option and in my opinion two things could be improved:
-
Android target SDK version is 25 which produces an error in IDEA because it seems Google Play Store requires a minimum version of 26. I changed the target and compile sdk version to 29 which got rid off this error but I am not 100% sure if this is everything you need to do. It seems to work for me but I am no gradle android expert
-
The lwjgl3 backend correctly recognizes src/main/kotlin as a source directory. The android backend does not do that. You need to adjust the build.gradle file and replace the …/java folders to …/kotlin. Would be great if the setup took already care of that. Maybe you can leave out those fixed file paths and then it accepts both java and kotlin directory as source directories?
-
One minor thing - why was desktop project renamed to lwjgl3? I personally would prefer if it is still called desktop.
-
One question from me: why is the core project e.g. adding its dependencies via
apiinstead ofimplementation? I thought api should be used in case you need to export these dependencies if someone is using your project as a dependency? Since you are going to develop a game or application which will not be used as a dependency, wouldn’t implementation than be the better option?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
Yep, I actually just committed 1.9.10.8 with that as the default for Kotlin projects. Drafting up a release now. I’m still not sure why Android is so hard to build right now for me; I seem to usually get out-of-heap errors or stack overflow inside Gradle on the majority of
:android:assembleDebugruns. It may be some setting on my local machine, or my build tools version (28.0.3)…I think I can close this now, since 4 and 2 seem to be solved, 3 seems to be OK as-is, and 1 is as good as I can get it (at least the versions are updated to what they should be). Thanks for the beta testing! 😃
Just pushed a commit that may help with point 1. I’m really struggling with this Android development work. The commit notes on 9f51d2ce9a64e5e95cf82ebdbe04d2a892fe1004 have some tips I found the hard way. I think I have an idea for Point 2; I changed in android/build.gradle
to
By hand in a generated project, and it recognizes android/src/main/kotlin as a source folder now.