Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Android studio doesn't launch any application (even new from the studio templates) and fails with the same error:

09/29 13:54:36: Launching app
$ adb push /Users/user/AndroidStudioProjects/MyApplication/app/build/outputs/apk/app-debug.apk /data/local/tmp/com.example.user.myapplication
$ adb shell pm install -r "/data/local/tmp/com.example.user.myapplication"
Aborted 


$ adb shell am start -n "com.example.user.myapplication/com.example.user.myapplication.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while executing: am start -n "com.example.user.myapplication/com.example.user.myapplication.MainActivity" -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.user.myapplication/.MainActivity }
Error type 3
Error: Activity class {com.example.user.myapplication/com.example.user.myapplication.MainActivity} does not exist.

Error while Launching activity

I tried clean/rebuild, even reinstall studio, but it didn't help. I can't understand what's happening, please help

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
648 views
Welcome To Ask or Share your Answers For Others

1 Answer

try adding this to your manifest on MainActivity

    <activity 
        android:name=".MainActivity"
        ...
        ...
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...