I'm starting to work on an existing project which uses standard java and partially Kotlin for some classes.
PROBLEM:
The projects compiles and runs fine, but when viewing the code in Android Studio, the classes written in kotlin show unresolved in the ide.
UserConfigActivity.kt (Class written in Kotlin)
class UserConfigActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_user_config)
setSupportActionBar(toolbar)
Unresolved when referenced/used in standard java class (although compiles and runs fine):
When opening the .kt
files directly in android studio it prompts that a plugin is found as follows:
But when i click on Install Plugins
, nothing happens (no install or change in situation). Prompt reappears next time i open another .kt
file.
QUESTIONS:
Cannot resolve symbol
for classes written in Kotlin?Install Plugins
?I'm on Android Studio 2.1.1
.
To install the Kotlin plugin, open the Settings dialog, select the "Plugins" node, press the "Install JetBrains plugin" button and select "Kotlin" from the list. Then restart the IDE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With