问题
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:
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