if your ubunt 18.04 is totally new, don't forget install the package from the link as below:
"https://www.yoctoproject.org/docs/3.0/ref-manual/ref-manual.html#detailed-supported-distros"
refer to the chapter 1.2. Required Packages for the Build Host, then install all of packages according to the chapter 3 Host Setup of yocto user guide
$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
export PATH=~/bin:$PATH
$ mkdir imx-yocto-bsp
$ cd imx-yocto-bsp
$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest
-b imx-linux-zeus -m imx-5.4.47-2.2.0.xml
$ repo sync
$ DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source imx-setup-release.sh -b build-wayland
$ bitbake imx-image-full
these are my building steps, try to delete the build folder then install all of ubuntu packages, then build the yocto step by step again, if you build one package failed, try to use cleansstate or cleanall to clean the pacakge and bitbake again.
I have built imx8mq and imx8mm with 5.4.47 successfully without error messages