Another solution that worked for me with Android Studio 3.1.2:
delete these from build.gradle
if you have them:
'com.android.support:appcompat-v7:27.1.1''com.android.support:design:27.1.1'
then sync, then undo delete, then sync again.
就是先删除v7包,sync,然后在还原v7,在aync 问题就解决了