Home>

android studio 3.6.3
API 29
Android X
In Java
I am learning how to create Chronometer of sample collection of nyan application development (https://akira-watson.com/android/chronometer.html).
I entered the code and started up the emulator, but there is an error and I do not know how to solve it. Thank you.

C: \ Users \ ashone \ AndroidStudioProjects \ Chronometer \ app \ src \ main \ res \ values ​​\ ids.xml: 3: 5-60: AAPT: error:inner element must either be a resource reference or empty.
`` `

Applicable source code



start_button
stop_button

..

  • Answer # 1

      

    inner element must either be a resource reference or empty.
      →inner element must be a resource reference or empty.

    So, I think you should do the following.

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

    https://stackoverflow.com/questions/52076491/android-inner-element-must-either-be-a-resource-reference-or-empty