Android Studio Design editor is unavailable until a successful build,不显示layout

现象1:如果出现错误提示Default activity not found,再点几次运行按钮也没用。

解决办法:先点击工具栏那个斧头型编译按钮再点击运行按钮就行了,不用像网上说的要修改Edit Configurations里面的内容。

现象2:XML布局写好了,点Text左侧的Design出现Design editor is unavailable until a successful build ,并且工具栏View–>Tool Windows–>preview选不了,如下图:
Android Studio Design editor is unavailable until a successful build,不显示layout_第1张图片
同时这里灰色选不了:
Android Studio Design editor is unavailable until a successful build,不显示layout_第2张图片
解决办法:工具栏File–>Invalidate Caches/Restart—>选中Invalidate Caches and Restart,如下图:
步骤1:
Android Studio Design editor is unavailable until a successful build,不显示layout_第3张图片
步骤2:
Android Studio Design editor is unavailable until a successful build,不显示layout_第4张图片

你可能感兴趣的:(Android Studio Design editor is unavailable until a successful build,不显示layout)