How can I add external library

You weren’t using maven, but gradle. In any case, if you use gradle you use gradle. If you mean without maven repositories, it is possible to add libraries from a project relative folder.