Hint: Compiled classes go under build/classes/kotlin/main by default [OK]
Common Mistakes:
Confusing source folder with output folder
Thinking build/libs holds class files instead of jars
Assuming non-standard output folders
4. You see this error when running Gradle: Could not find method kotlin() for arguments. What is the likely cause?
medium
A. The Kotlin plugin is not applied in build.gradle.kts
B. The source folder is missing
C. The JVM target version is invalid
D. The Gradle wrapper is outdated
Solution
Step 1: Understand the error message context
The error means Gradle does not recognize the kotlin {} block, usually because the Kotlin plugin is missing.
Step 2: Check common causes
Missing plugins { kotlin("jvm") version "x.y.z" } causes this error. Source folder or JVM target issues cause different errors. Outdated Gradle wrapper usually causes version incompatibility errors.
Final Answer:
The Kotlin plugin is not applied in build.gradle.kts -> Option A
Hint: Check if Kotlin plugin is applied when kotlin() method errors occur [OK]
Common Mistakes:
Assuming source folder missing causes this error
Blaming JVM target version without checking plugin
Ignoring plugin application in build script
5. You want to add a new resource folder to your Kotlin project for configuration files. Where should you place it to follow standard Gradle project structure?
hard
A. src/resources/main
B. resources/config
C. src/main/resources
D. config/resources
Solution
Step 1: Recall standard resource folder location
Gradle expects resource files in src/main/resources to include them in the build output.
Step 2: Differentiate from incorrect folder structures
Folders like resources/config, src/resources/main, or config/resources are not standard and won't be automatically included.
Final Answer:
src/main/resources -> Option C
Quick Check:
Resource files go under src/main/resources [OK]
Hint: Put resource files in src/main/resources for Gradle to find them [OK]
Common Mistakes:
Placing resources outside src/main folder
Using non-standard folder names
Not including resources in build output
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.