I am trying to build an Android app with multiple package name for better structure. My current package is src/com/waveletandroid.
I have made a folder under src/com/waveletandroid/customer and created SearchCustomerActivity.java inside this folder. Also created a new folder in res/layout/customer. activity_search_customer.xml file has been created inside this res/layout/customer folder.
Now when I am trying to build the project it’s throwing error “R cannot be resolved as variable”.
There are problems with your resource files.
This will result in not generating R.java, which leads to “R cannot be resolved as variable“.
The origin of this error is creating folders within the layout folder. This is not allowed by Android. The usage of multiple packages is supported and is advisable to do.