Reputation: 41
Unfortunately I have often (that's the third time!) working with Android project in Eclipse (directly with Debug) and usually after I update the graphic layout of an XML file, to appear in my classes a series problems, such as: R.drawable.myIcon "can not be resolved myIcon or not is a field" and so for all graphic objects / resources in the XML file layout graph to which I had previously given an ID. Every time I have to return to the last saved version of the project :(
I searched in internet possible causes and solutions ..... the possible solutions I have tried everything .....
"comment" all the error code to recompile the Eclipse project and get a clean design and error
Re-create a new workspace and import the project
I updated the Android SDK, which was still very recent. (SDK from revision 11 to revision 12).I updated: - Eclipse Platform/Platform SDK/Eclipse SDK
I tried F5-Refresh in Eclipse
9).I tried ANT (apache-ant-1.8.2-bin.zip) to Automate Building Android Applications (Build.XML has successfully created both from DOS and from Eclipse)
but in the end I can never fix the bug where only in my class all the specific resources of the file / class JAVA R. are not seen.
Report From: R. JAVA-file that the resources referred to by my class there are in fact! -In Window "Error Log" is the error: "Invalid preference page path: XML Syntax" but with no reference to any file -Graphical layout of the XML file there is no error message Someone managed to solve this problem in Android ?
Upvotes: 4
Views: 4559
Reputation: 900
And just to say it, my answer to this same question was correcting my Android project's targetSdkVersion in the Manifest.xml to match the project properties. =X
Those XML problems.. they'll getcha! :P
Upvotes: 0
Reputation: 2960
If all those things tried by user840370 doesn't solve the error
"Invalid preference page path: XML Syntax"
Just import com.your.packagename.R
class and it will work !
Upvotes: 3
Reputation: 20346
Names of files in resources can't contain capital letters, so myIcon
is wrong name. File names must contain only [a-z0-9_.] (small letters, numbers, '_' and '.').
Upvotes: 2
Reputation: 51
I encountered this problem.
It turned out to be due to duplicate id's in one of my layout files.
Upvotes: 2