Reputation: 11
I am developing an app, and have started working on main screen design but I am not able to test my app. When I want to test the app it suddenly stop all the time and error showing in catlog in the line
setContentView(R.layout.activity_main)
I have attached the screenshots in this question also.
Upvotes: 0
Views: 4320
Reputation: 1
vibhor vibhoti -- your problem is that you are using ( view ) tag with v small in your activity_main.xml change it to ( View ) with Capital V .. that is the SOLUTION
Upvotes: 0
Reputation: 487
R.java is automatically generated on build, and it is automatically imported so you don't have to import it explicitly.
Try this:
Upvotes: 0
Reputation: 20626
I invite to you to clean project and rebuild again, you have the how to here.
And remove those imports that contains R
in your project.
import vibhor.dev.eat24.R;
import vibhor.dev.eat24.R.layout;
I see you have this :
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
}
Change it to :
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
This is problem of your library, take a look on this answer, try it, if it does not work.. just change the library.
Upvotes: 1
Reputation: 49
try that solution:
check that the import for R class is not import com.android.R;
and you should make it import yourpackagename.R, then recompile
if it works, your answer has already been replied here.
Upvotes: 0