I was working on my android project. After completing some coding, I imported remaining classes by pressing ctrl+shift+o. Than I cleaned my project. After cleaning the project I lost my BuildConfig.java file. How can i get it back? I think that R.java is now renamed as BuildConfig.java.(For all developers) Am i right? Thank you in advance.

有帮助吗?

解决方案

Make sure you haven't imported an foreign R file. Occasionally, CTRL+SHIFT+O will import android.R which will mess up your project. Delete the import statement, clean and build your project again.

其他提示

You should have an BuildConfig.java and an R.java in your gen folder (inside your package).

If the R.java isn't generated after cleaning, make sure that you don't have any errors in your layouts. (An layout error will cause the R to be removed and not to come back before a clean :) )

Clean the project 2-3 times. It will work.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top