在Android Studio中启动活动时出错 [英] Error while launching activity in Android Studio

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

问题描述

我正在尝试制作一个具有多个Java文件的Android Studio应用.但是,当我尝试运行我的应用程序时,它说:

I am trying to make an Android Studio app that has more than one java file. However, when I was trying to run my app, it said:

Error while executing: am start -n "com.example.company.appname/com.example.company.appname.Text" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.company.appname/.Text }
Error type 3
Error: Activity class {com.example.company.appname/com.example.company.appname.Text} does not exist.

Error while Launching activity

选择/运行调试配置"还说文本"丢失.我有一个Text.java文件.发生了什么事?

The Select/Run Debug Configuration also said "Text" was missing. I have a Text.java file, however. What's going on?

我的窗口是什么样的:

What my window looks like:

AndroidManifests.xml:

AndroidManifests.xml:

推荐答案

在清单文件中,您仅声明了两个活动(FirstActivity和Speech),但没有声明Text活动.

In your manifest file you have declared only two activities (FirstActivity and Speech), but no Text activity.

Android无法启动未添加到AndroidManifest.xml中的活动.

Android cannot start activities not added in AndroidManifest.xml.

欢呼

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

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