int. Compare against ErrorCode. Construction and processImage can also throw or return null.
ErrorCode
-1 is invalid argument. -2 is not initialized.Construction
new BeautyEffectEngine(context, config) throws IllegalArgumentException when:
contextorconfigisnullconfig.isValid()isfalse(nolicenseTokenand missingappId/appKey)
null.
Auth troubleshooting: Auth & License. Enable logging before construct — see Implement Beauty.
processImage
nullinput ornulltype→IllegalArgumentException- Engine already
release()d →null(no exception) - Always
release()both input and output in afinallyblock
convert, toBitmap), release the extra frame too.
Filters, stickers, virtual background
Empty path or emptybyte[] returns ErrorCode.INVALID_ARGUMENT. Missing files typically return ErrorCode.IO.
processImage results and SDK logs.
Logging setup
setLogConfig throws if config or level is null. Create parent directories before enabling file logs.
Out of memory
ErrorCode.OUT_OF_MEMORY or OutOfMemoryError usually means frames are not released, resolution is too high, or heap/direct buffers accumulated.
- Use
ByteBuffer.allocateDirectfor camera / packed pixels - Release every
ImageFrame(includingconvertresults) - Prefer
FrameType.VIDEOfor live camera - Do not construct a new engine every frame

