Cannot find R.layout.activity_main

后端 未结 29 2165
轮回少年
轮回少年 2020-12-01 01:58

I was trying to work out with multiple layout using some online tutorials. The thing is my program was building and compiling correctly as long as there was only one XML fil

相关标签:
29条回答
  • 2020-12-01 02:40

    My error got removed by importing the line

    import com.example.myapplication.R;
    

    your import line may be different depending upon your project name in which my project name is myapplication

    0 讨论(0)
  • 2020-12-01 02:42

    Ivwd simply removed line "import android.R;" and call Project->Clean... That was enough for my on Win-7/x64 and Eclipse Kepler and last (02.2014) Android SDK

    0 讨论(0)
  • 2020-12-01 02:43

    goto tools->android->Sync project with gradle file then click on S

    0 讨论(0)
  • 2020-12-01 02:43

    I used maven as build tool, after I build my project and dig a lot in the internet to solution. My problem resolved by adding to the main_activity.xml

    tools:context=".MainActivity"

    0 讨论(0)
  • 2020-12-01 02:44

    Happened once. Don't know the reason.

    Build> Clean Project removed the error for me.

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