Attribute android:id is not allowed here in new kotlin project in activity_main.xml

后端 未结 3 821
有刺的猬
有刺的猬 2021-01-21 14:39

I get errors in new Android Studio project in Kotlin connected with attributes: \'Attribute android:x is not allowed here\"

file: activity_main.xml



        
相关标签:
3条回答
  • 2021-01-21 15:21

    Have you tried to rebuild or clean your project? I think you should try that then run the app again

    0 讨论(0)
  • 2021-01-21 15:29

    In your root element, replace:

    xmlns:android="http://www.w3.org/1999/XSL/Transform"
    

    with:

    xmlns:android="http://schemas.android.com/apk/res/android"
    

    Also, remove xmlns="http://schemas.android.com/apk/res/android" from your root element.

    0 讨论(0)
  • 2021-01-21 15:37

    Try syncing project with Gradle files: File -> Sync project with Gradle files.

    0 讨论(0)
提交回复
热议问题