Android Studio mac打开activity_main.xml错误解决方法

src/layout/activity_main.xml 打不开显示Design editor is unavailable until after a successful project sync
Android Studio mac打开activity_main.xml错误解决方法_第1张图片

需要点击 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 可以打开如下图

Android Studio mac打开activity_main.xml错误解决方法_第2张图片

你可能感兴趣的:(android,android,studio,activity_main,xml,gradle,time,out)