AddResource returns an error on invalid init.