I see a lot of posts about writing to the SD card, but I believe my problem is different. I am unable to create the SD card during the process of building an AVD.
After a lot of installing and not getting any result I found this and it worked.
This happens because some executable files in sdk/tools cannot be executed. Go to your Android Studio and Android SDK folders and make all directory and files executable by this command: