src/layout/activity_main.xml 打不开显示Design editor is unavailable until after a successful project sync
需要点击 File->Sync Project with Gradle Files
如果显示下载
Download gradle-7.4-bin.zip… time out
那么就在当前代码文件夹下搜索文件:gradle-wrapper.properties
然后打开编辑:
找到
distributionUrl=https://services.gradle.org/distributions/gradle-7.4-bin.zip
把services.gradle.org替换成downloads.gradle-dn.com
如下
distributionUrl=https://downloads.gradle-dn.com/distributions/gradle-7.4-bin.zip
然后在继续点击 File->Sync Project with Gradle Files 可以下载
然后再点击activity_main.xml 可以打开如下图