Question

my android app development ran into the issue with the R.java file not appearing and causing a host of other errors. I believe that might be remedied or either will be after I fix these Console Errors:

[2014-05-03 18:13:58 - Tag] W/ResourceType( 1008): Bad XML block: node attributes use 0x161aa8 bytes, only have 0x14 bytes
[2014-05-03 18:13:58 - Tag] W/ResourceType( 1008): ResXMLTree_node header size 0 is too small.
[2014-05-03 18:13:58 - Tag] H:\android stuff\projects\Tag\res\menu\display_map.xml:6: error: No resource identifier found for attribute 'showAsAction' in package 'com.JTInc.tag'
[2014-05-03 18:13:58 - Tag] H:\android stuff\projects\Tag\res\menu\map.xml:6: error: No resource identifier found for attribute 'showAsAction' in package 'com.JTInc.tag'

I am not sure based on these what I should do. This the code for map.xml

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.JTInc.tag.MapActivity" >

    <item
        android:id="@+id/action_settings"
        android:orderInCategory="100"
        android:title="@string/action_settings"
        app:showAsAction="never"/>

</menu>

So do I need to edit something on line 6? Would this be causing the resource file to not correctly work? All help is greatly appreciated. Thanks

Was it helpful?

Solution

Inside your <item> tag (which is on line 6), you need to change app:showAsAction="never" to android:showAsAction="never". In order for R.java to build properly, your XML needs to be error-free, which is why you get the R.java error.

OTHER TIPS

I think there is something wrong with your variables, because the class R.java is an auto generated file when you build an android application. It contains unique identifiers (normally 32bit numbers) for elements in each category (drawable, string, layout, color, etc.) of resources (elements under directory res) available in your android application. The main purpose of R.java file is quick accessibility of resources in the project. Normally, the programmer did something wrong causing errors in R class.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top