我刚刚从"file">“新建”>“Activity ”创建了一个空白 Activity 。它的MainActivity.java
是可编辑的,menu_main.xml
也是一样,但是activity_main.xml
布局文件是打不开的。没有错误消息,没有任何迹象表明任何事情正在发生,什么都没有。我还尝试删除 Activity 并重新创建它。
Android Studio 已更新到最新版本(1.2.1.1),我尝试打开和关闭它。 我在 Mac OS X 10.10.3 上运行它,该文件存在于 IDE 指示的文件系统中。
有人遇到过这个问题吗?
编辑:刚刚尝试重新启动我的电脑,同样的事情发生了。
编辑 2:我的 build.gradle
apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "ca.etsmtl.gti785.telebama" minSdkVersion 16 targetSdkVersion 22 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.1.1' testCompile 'junit:junit:4.12' testCompile('org.robolectric:robolectric:3.0-rc2') { exclude group: 'commons-logging', module: 'commons-logging' exclude group: 'org.apache.httpcomponents', module: 'httpclient' } }
最佳答案
我猜问题可能出在所选的预览 API 或设备上。在预览中查看此工具栏。
关于java - 无法在 Android Studio 中打开布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30203784/