Categories
Android Eclipse Java SDK

Eclipse – “Syntax error on token “…”, invalid VariableDeclaratorId”

When you import an image into your res folder show following error message of type Java Problem:

Syntax error on token “{filename}”, invalid VariableDeclaratorId

because file name is invalid: must contain only [a-z0-9_.]
ie, file name must start with a lowercase letter, then it may contain lowercase/uppercase letters or numbers or underscores or dots.

Select file name on the Package Explorer then
click the right mouse button -> Refactor -> Rename
or

press Alt+Shift+R
and insert valid file name.

Did my solution solve your problem?

Categories
Android Eclipse SDK

Eclipse – “ERROR/AndroidRuntime(…): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{…}: java.lang.ClassNotFoundException:…”

Verify that in your Manifest file there is activity tag like this

<activity android:name=“.classname”>

and that classname is the name of class that

extends Activity

Did my solution solve your problem?