When you're exporting with Xcode 9 or later, they will ask you if you want to Strip Swift symbols:
Well, don't uncheck it! And the error will be gone.