Fixed NPE for metadata while handling collection of complex
Fix build issues for android edition