For my case, my code can run on vs code only after I have run the code from Xcode (have to run at least once from Xcode before running from vs code). As a reminder, you have to run flutter run --release if you want to use it even after you quit the flutter run.