最新的Android Studio,应用程序无法运行;显示空白
我刚刚更新到最新的Android Studio(2.3.1),当我运行我的应用程序时,它不起作用-我应该看到一个包含文本的列表视图,但我只看到一个空白的白色屏幕 我正在写android编程的Udacity简介,所以我知道的不多。如果有帮助的话,我现在是第三课的开始 Logcat显示: 28860-28860 W:执行失败(/system/bin/dex2oat--runtime arg-classpath--runtime arg-debugable--instruction set=arm--instruction set features=smp,div,-atomic--runtime arg-Xrelocate--boot image=/system/framework/boot.art--runtime arg-Xms64m--runtime arg Xmx512m--compiler filter=speed--instruction set variant=cortex-a7--instruction set features=default--dex file=/data/app/com.example.android.sunshine.app-2/split_lib_slice_9_apk.apk--oat file=/data/dalvik cache/arm/data@app@com.example.android.sunshine.app-2@split_lib_slice_9_apk.apk@类。dex),因为非0退出状态 更新-------- 通过一些调试,我可能已经在MainActivity中的以下代码中缩小了问题的范围:最新的Android Studio,应用程序无法运行;显示空白,android,Android,我刚刚更新到最新的Android Studio(2.3.1),当我运行我的应用程序时,它不起作用-我应该看到一个包含文本的列表视图,但我只看到一个空白的白色屏幕 我正在写android编程的Udacity简介,所以我知道的不多。如果有帮助的话,我现在是第三课的开始 Logcat显示: 28860-28860 W:执行失败(/system/bin/dex2oat--runtime arg-classpath--runtime arg-debugable--instruction set=arm--
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new ForecastFragment())
.commit();
}
}
getSupportFragmentManager方法甚至无法识别并显示为红色。我以前必须更改导入语句以使代码片段正常工作。这可能是因为您尚未为ListView分配ID 添加这样的ID。
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
如果这不起作用,请尝试通过单击构建>清理项目来清理构建broject这看起来不像我的logcat报价,而是gradle控制台/log。查看LogcatI再次选中。这显然是来自Android监视器中的logcat。如果您指的是底部显示“终端”的选项卡不是那样的。谢谢你的回复。我检查过了,所有的身份证都有了,看起来都是正确的。