R.java file is not getting created

后端 未结 5 944
走了就别回头了
走了就别回头了 2021-01-06 21:45

I had R.java file in my android application. But I don\'t know, It is delete some how. To create it again I clean my project and also Rebuild my project by clicking on Build

5条回答
  •  囚心锁ツ
    2021-01-06 21:59

    Some quick solutions to your problem might be,

    • use the Ctrl + Shift + O command to "Organize Imports" and generate any missing import statements. Sometimes this would generate the incorrect import statement which would hide the R.java class that is automatically generated when you build.
    • R is a generated class. If you are using the Android Development Tools (ADT) it is generated whenever the project is built. You may have 'Build Automatically' turned off. Turn it on and build your project.
    • Mistakes in your xml views could cause the R.java not to be generated. Go through your view files and make sure all the xml is right!
    • Remove, if any import android.R;
    • Restart your IDE.

提交回复
热议问题