Am getting the error message:
Attribute value must be constant
while defining a Space annotation for my Space class:
I've looked at the question In Java why this error: 'attribute value must be constant'? which is the closest to my problem but it doesn't help.
Am using the latest Vault
library:
compile 'com.contentful.vault:core:2.1.0'
The previous version didn't require a Locale
attribute.
How do I solve this?
If you look at the Javadoc for Space
you'll see that the locales
attribute is a String[]
- so just provide the IDs of the locals:
@Space(value = "id",
dbVersion = 1,
models = NewsVault.class,
locales = { "en" })
See more on this question at Stackoverflow