Java – Android studio does not parse classes written in kotlin (. KT) in the IDE, but compiles well

I started working on an existing project that uses standard Java and some classes of kotlin

Question:

These projects compile and run well, but when viewing the code in Android studio, the classes written with kotlin are not resolved 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)

Not resolved when referenced / used in standard Java classes (although compiled and running normally):

Open it directly in Android studio KT file, it will prompt to find a plug-in, as shown below:

However, when I click install plug-in, there is no response (no installation or change) Open another one next time KT file, the prompt will reappear

Question:

>How to solve the problem that the symbols of classes written in kotlin cannot be resolved? > How do I install plug-ins provided in the prompt but not installed when installing plug-ins?

I'm in Android studio 2.1 1

Solution

To install the kotlin plug-in, open the settings dialog box, select the plug-in node, press the install JetBrains plug-in button, and then select kotlin from the list Then restart the IDE

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>