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

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

问题描述

我创建了一个 Wear 应用并使用 Android Studio 模板来创建它,除了将按钮拖放到 Wear 应用的 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.

当我尝试在运行/调试配置"中运行手表应用程序时,会勾选启动默认活动,然后会出现一条错误消息:错误:未找到默认活动".

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 执行时如何让手表应用程序执行并启动其活动?

If its not applicable, then how do I get the watch app to execute and launch its activity when executed directly using 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天全站免登陆