"Error: Identifier expected" when trying to compile a project with res/raw videos

Asked

Viewed 140 times

1

I’m making an application only to manage videos that are already inside the application inside the res/raw folder, but when I compile without calling the videos, it gives the errors:

Error: Identifier expected

and

Error: illegal start of type

inserir a descrição da imagem aqui

  • 2

    Welcome to SOPT. Would like to [Edit] your post and add the code you are using, so we can analyze and suggest a change. Thank you.

  • 1

    It is also important to inform which error logcat, so we will have a bigger direction to find the solution.

  • This one, sorry for the delay

1 answer

1


The problem is that the names of your files start with number.

How the Android SDK uses file names to create corresponding variables in the file R.java, if you use a name other than a valid Java identifier, the R.java does not compile. The same goes for images.

Try changing the names of the videos to, for example, video_1.mp4, video_2.mp4 etc..

  • That really was the mistake, thank you, it’s solved :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.