默认 Activity 未找到 启动时出错 activity

Default Activity not found Error while Launching activity

错误 enter image description here

03/02 22:01:22:正在启动应用程序 没有本地更改,没有部署 APK 无法识别启动 activity:未找到默认值 Activity 启动时出错 activity

这是我的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 文件 **

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'
      }
  }
}

如下更改您的意图过滤器

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

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

您添加了两次 action 而不是 category

试试这个,

    <?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>