Rehan khan
Rehan khan

Reputation: 59

Default Activity not found Error while Launching activity

Error enter image description here

03/02 22:01:22: Launching app No local changes, not deploying APK Could not identify launch activity: Default Activity not found Error while Launching activity

This is my AndroidManifist.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.rehankhan.teachercourse">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <!-- permission required to use Alarm Manager -->
        <uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
        <uses-feature android:name="android.hardware.sensor.stepcounter" />
        <uses-feature android:name="android.hardware.sensor.stepdetector" />

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".SignUP" />
        <activity android:name=".T_TimeTABLE" />
        <activity android:name=".Parent_MAin" />
        <activity android:name=".attendenceSheet" />
        <activity android:name=".Review_from_teacher" />
        <activity android:name=".welcom" />
        <activity android:name=".Student_MAin" />
        <activity
            android:name=".Fine_attendence"
            android:label="@string/title_activity_fine_attendence"
            android:theme="@style/AppTheme.NoActionBar" />

        <service android:name=".NotifyService" />
        <service android:name=".step_counter"/>

        <activity android:name=".gps" />
        <activity android:name=".course_of_review" />
        <activity android:name=".Teacher_MAP"></activity>
        <activity android:name=".std_course_review"></activity>
    </application>

</manifest>

**Gradle file **

apply plugin: 'com.android.application'
android {
  compileSdkVersion 23
  buildToolsVersion "23.0.3"

  defaultConfig {
      applicationId "com.example.rehankhan.teachercourse"
      minSdkVersion 15
      targetSdkVersion 23
      versionCode 1
      versionName "1.0"
      multiDexEnabled true

  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }
}

Upvotes: 1

Views: 796

Answers (2)

Komal12
Komal12

Reputation: 3348

Try this,

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.rehankhan.teachercourse">

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <!-- permission required to use Alarm Manager -->
        <uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
        <uses-feature android:name="android.hardware.sensor.stepcounter" />
        <uses-feature android:name="android.hardware.sensor.stepdetector" />

    <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />


        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

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

        <activity android:name=".SignUP" />
        <activity android:name=".T_TimeTABLE" />
        <activity android:name=".Parent_MAin" />
        <activity android:name=".attendenceSheet" />
        <activity android:name=".Review_from_teacher" />
        <activity android:name=".welcom" />
        <activity android:name=".Student_MAin" />
        <activity
            android:name=".Fine_attendence"
            android:label="@string/title_activity_fine_attendence"
            android:theme="@style/AppTheme.NoActionBar" />

        <service android:name=".NotifyService" />
        <service android:name=".step_counter"/>

        <activity android:name=".gps" />
        <activity android:name=".course_of_review" />
        <activity android:name=".Teacher_MAP"></activity>
        <activity android:name=".std_course_review"></activity>
    </application>
    </manifest>

Upvotes: 0

arjun
arjun

Reputation: 3574

Change you intent filter as below

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

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

you have added action twice instead of category

Upvotes: 1

Related Questions