Android - Inner Element Must Either Be a Resource Reference or Empty

Android - Inner element must either be a resource reference or empty

When declaring id in resources, the body should be empty

<item
type="id"
name="id_name" />

For more info please have a look on below link

https://developer.android.com/guide/topics/resources/more-resources#Id

So as Oliver Manyasa mentioned, it should be as below

<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="tv_deviceName" type="id"/>
</resources>

error: item inner element must either be a resource reference or empty?

After lot of search I found that it was one of my library which was causing this issue. The library I was using was not compatible with gradle 3.2.1 and which was causing the issues in compilation.

Error: item inner element must either be a resource reference or empty

My project includes a library "Android-RecurrencePicker" that is not adapted for Android Studio 3.2.0.
There is an issue to the author for updating his library - https://github.com/Shusshu/Android-RecurrencePicker/issues/17#issuecomment-428330873.

Eventually, the solution was to download this 3d party library to project and include in a project locally. After this, I changed dependencies and refactored code of this library manually.



Related Topics



Leave a reply



Submit