Issue can be fixed by "sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/x86_64-linux-gnu/libncurses.so.5" to build AOSP on Ubuntu 24.04.
But I know that it is just a WA and has some lucks.