“未找到默认活动";适用于使用Android Studio模板创建的可穿戴应用 [英] "Default activity not found" for a wearable app created with Android Studio template

查看:162
本文介绍了“未找到默认活动";适用于使用Android Studio模板创建的可穿戴应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了磨损应用程序,并使用Android Studio模板创建了它,除了将按钮拖放到磨损应用程序的MainActivity之外,没有进行任何其他更改.

I've created a wear app and used the Android Studio template to create it and haven't made any changes other than to drag and drop a button onto the MainActivity of the wear app.

当我尝试在运行/调试配置"中的启动"时运行watch app时,勾选了默认活动",然后出现一条错误消息:错误:未找到默认活动".

When I try and run the watch app in the Run/Debug Configurations is Launch default Activity is ticked then there is an error message saying: "Error: Default Activity not found".

我已经搜索过有关此内容的文章,答案是关于模块源和内容的.在这种情况下,这真的是正确的解决方案吗?如果是这样,那么为什么Android Studio首先不能正确设置所有内容-在通过AS模板创建所有项目之后,为什么模板不能正确设置所有内容?

I've searched for previous posting on this and the answer is messing around with module sources and stuff. Is that really the correct solution in this situation? If so, then why isn't the Android Studio setting everything up correctly in the first place - after all the project was created by an AS template, why isn't the template setting things up correctly?

如果它不适用,那么当直接使用Studio执行时,如何使watch应用执行并启动其活动?

If its not applicable, then how do I get the watch app to execute and launch its activity when executed directly using Studio?

Studio版本:1.0.2

Studio Version: 1.0.2

推荐答案

添加Watchface之后,我也遇到了类似的问题,并认为我会为自己解决问题.

I also had an issue similar to this after adding a Watchface, and thought I would chime in with what fixed it for me.

在Android Studio 2.2.1中:运行->编辑->您的应用->表盘->常规->启动选项->启动:没什么

In Android Studio 2.2.1: Run -> Edit -> Your App -> watchface -> General -> Launch Options -> Launch: Nothing

默认情况下,选择我的来运行默认活动,这对于表盘来说是不正确的.

By default, mine was selected to run the default activity, which is incorrect for a watch face.

这篇关于“未找到默认活动";适用于使用Android Studio模板创建的可穿戴应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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