I had the same problem.
I followed the following steps.
DISCLAIMER: USE AT YOUR OWN RISK, THIS WORKED FOR ME, NO GUARANTEES THAT THIS WILL WORK FOR YOU
ALWAYS BACKUP your system !!!
Install busybox from stericson
Install busybox. mine got installed with symlinks in /system/xbin to busybox
Reboot to recovery, make sure that system is mounted,
through adb copy sed from /system/xbin to /sbin
then install XPOSED.
after rebooting, optimizing apps took a very long time and kept switching from the blackview logo to optimizing apps, although the total number of apps kept decreasing each time. Took about 10 minutes, then the total number of apps increased again (Keep a adb logcat -s *:I running for peace of mind that something is happening)
Finally took total 20mins for optimizing apps.
check your environment and paths to make sure if this is similar to your environment.