Search code examples
androidandroid-gradle-pluginandroid-manifest

android manifestPlaceholders - how to use a boolean


Manifest placeholder i have created looks like this:

manifestPlaceholders = [appDrawerName: "Staging",canExport:"true"]

and i am trying to use it to set the following exported property on an activity:

<activity android:name=".UI.product.ProductDetailsHostActivity"
           android:theme="@style/NoActionBarTheme"
           android:exported="${canExport}"/>

But i get the following error:

enter image description here any ideas on how i can resolve this ? i tried using canExport:true without the quotes but same results.

btw, the first placeholder works fine.


Solution

  • You have to supply a boolean value instead of the string in manifestPlaceholders array.

    change this

    manifestPlaceholders = [appDrawerName: "Staging",canExport:"true"]
    

    to

    manifestPlaceholders = [appDrawerName: "Staging",canExport:true]
    

    notice the boolean true instead of string "true"