Just now I encounter the same problem. It happened because after doing "flutter run" there's still some file that needs to be downloaded, the build tools
, but didn't get downloaded correctly, because I stopped it in the middle, since I thought the process was stuck.
So, these are the steps that solve the problem:
- open terminal
- change directory to
/Users/[USERNAME]/Library/Android/sdk/build-tools/
, in your case, type cd /Users/sachin/Library/Android/sdk/build-tools/
- remove the folder that causes the error, in your case the
26.0.2 folder
, so in your terminal type rm -r 26.0.2
to remove it.
- go back to your code, make sure the android simulator is detected, and re run the project
- now, wait patiently, it may takes sometime (depends on internet connection), but it's downloading the
build tools
, you can watch this in the finder by typing open .
- make sure that in the
26.0.2 folder
there's aidl
file added when the process is finished.
- it should be working, if not, just rebuild/re-run your code one more time. Done!