简体   繁体   中英

I often found this specific error: “Could not identify launch activity: Default Activity not found Error while Launching activity”

This is my adb shell commands to install application, each time when i install app, it show default activity not found.

$ adb shell pm install -t -r "/data/local/tmp/it.dabbl"
    Success
    APK installed in 9 s 725 ms
    Could not identify launch activity: Default Activity not found
    Error while Launching activity

you have to define your launcher activity in manifest.

  <activity
    android:name=".MainActivity" //Whatever Activity you want to launch first>
      <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

So after searching on internet over an hour, i have check from project structure that i have not set the default config settings. To resolve this issue you have to open project structure and then add default config and then synced with gradle will solve this issue.

I had this same problem and solved it by manually setting the launch activity. From the menu select "Run -> Edit Configurations...", and then under "Launch Options" select "Launch: Specified Activity" and "Activity: your.launch.activity" where "your.launch.activity" is the activity you want to launch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM