Aphria Inc. has agreed to pay $30 million to settle a class-action lawsuit by shareholders alleging the company made misrepresentations to capital markets in 2018.