Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
663 views
in Technique[技术] by (71.8m points)

android - Crash while trying to launch any application

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

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

1 Reply

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...