Getting errors saying that an Android method setTranslationZ is not found

I’m trying to integrate a new SDK into my project, and one of the functions they use is the view function setTranslationZ():

http://developer.android.com/reference/android/view/View.html#setTranslationZ(float)

I have Android-21 installed on my machine, and I’ve set the app target to Android-21 in both AndroidManifest and project.properties.

I can see in my Android SDK folder that the view.java file does have the setTranslationZ function in it. 

However when I build the app and run it, I get a message telling me the method was not found. Does anyone know if there is another step I could have missed?  

One thing I did notice was that at first the error meant that the app didn’t even get beyond the splash screen, it just froze there. When I changed my plugin code to call the new SDK on the main UI thread it got past the splash screen and displayed the buttons I’ve created in main.lua, but still shows the same error message.

Any ideas would be appreciated.