androidandroid-resourcesaaptandroid-restrictions

Error:(8, 30) String types not allowed (at 'description' with value 'Public Albums of this username will be fetched')


I am trying to configure restrictions in my Application but I am getting following error

Error:(8, 30) String types not allowed (at 'description' with value 'Public Albums of this username will be fetched'). Error:Execution failed for task ':app:processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\athakur\Softwares\adt-bundle-windows-x86_64-20140702\sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1

My app_restriction.xml is as follows -

<?xml version="1.0" encoding="utf-8"?>
<restrictions xmlns:android="http://schemas.android.com/apk/res/android" >

    <restriction
        android:key="google_username"
        android:title="Google Username"
        android:restrictionType="string"
        android:description="Public Albums of this username will be fetched"
        android:defaultValue="opensourceforgeeks" />

</restrictions>

If I remove description it works fine. I have used same syntax as specified on android dev page i.e

<?xml version="1.0" encoding="utf-8"?>
<restrictions xmlns:android="http://schemas.android.com/apk/res/android" >

  <restriction
    android:key="downloadOnCellular"
    android:title="App is allowed to download data via cellular"
    android:restrictionType="bool"
    android:description="If 'false', app can only download data via Wi-Fi"
    android:defaultValue="true" />

</restrictions>

Not sure what I am missing. Any help is appreciated.


Solution

  • The description value for a Restriction element must be a String Resource, as documented here. Extracting the hardcoded text will therefore fix the build.