Error: Could not pre-launch appium: Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity

I’m trying to run Appium on an Android emulator and I am getting this error:

error: Could not pre-launch appium: Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity

I entered the ff. details in my Appium Android settings:

Package: com.mod.mid.mobile.android
Launch Activity: com.mod.mid.mobile.android/.MID

Those were the details I got from the AndroidManifest.xml so I believe those values are correct. Here’s a snippet of the first part of the xml file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mod.mid.mobile.android">
    <!--
    android:versionCode="5"
    android:versionName="1.3.0"
    -->
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:xlargeScreens="true"/>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <permission android:name="com.example.gcm.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
    <uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/AppTheme">
        <activity android:name=".MID"
            android:label="@string/app_name" android:screenOrientation="portrait" android:clearTaskOnLaunch="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

Does anybody have an idea why I’m getting the error? Thanks a lot!

Run below commands to fetch package and launcher activity from apk

package :
D:\Android\sdk\build-tools\23.0.2>aapt d badging C:\Users\Swami\Desktop\AndroidCalculator.apk |FINDSTR package

launchable-activity:
aapt d badging C:\Users\Swami\Desktop\AndroidCalculator.apk |FINDSTR launchable-activity

Note : replace FINDSTR with grep if u run it from java/linux/mac

Got it! Thanks so much for those commands. The launch activity I entered previously was slightly different and should have no backslash.