Error while launching activity in Android Studio

感情迁移 提交于 2021-02-08 05:57:36

问题


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

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: no desc

AndroidManifests.xml: !


回答1:


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

Android cannot start activities not added in AndroidManifest.xml.

Cheers



来源:https://stackoverflow.com/questions/41132529/error-while-launching-activity-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!