在 Android Studio 中找不到默认活动 [英] Default Activity not found in Android Studio

查看:35
本文介绍了在 Android Studio 中找不到默认活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到 Android Studio 0.2.8,当我尝试编辑运行配置时收到一条错误消息,提示未找到默认活动".

I just upgraded to Android Studio 0.2.8 and I am getting an error that says "Default Activity not found" when I try to edit the run configurations.

当我启动 Android Studio 时出现此错误仅允许从事件调度线程访问"

When I launch Android Studio I get this error "Access is allowed from event dispatch thread only"

我使用的活动是片段活动.

The activity I am using is a fragment activity.

到目前为止,我已经尝试过重建并使缓存/重启无效.两个都没用.

So far I've tried rebuilding and invalidate caches/restart. Both were of no use.

请告诉我我能做些什么来解决这个问题.

Please let me know what I can do to fix the problem.

推荐答案

在 Android Studio 中,右键单击项目并选择打开模块设置.然后转到模块中的 Sources 标签,找到 src 文件夹,右键单击它并标记它作为来源(蓝色).

In Android Studio, right click on the project and choose Open Module Settings. Then go to the Sources tab in your module, find the src folder, right click on it and mark it as Sources (blue color).

在更高版本的 Android Studio 中没有源选项卡,但您可以改为编辑 build.gradle 文件:https://stackoverflow.com/a/22028681/1101730(感谢 Josh 的评论)

There is no sources tab in later versions of Android Studio, but you can edit the build.gradle file instead: https://stackoverflow.com/a/22028681/1101730 (thanks for comment Josh)

这篇关于在 Android Studio 中找不到默认活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆