Merge "Return error to NDK on failure" into sc-dev