运行应用程序时出现Android应用程序错误

Har*_*iya 0 java android

每当我尝试运行我的应用程序时,屏幕截图中的这个窗口就会弹出我的屏幕.声明找不到默认活动,因为我无法部署我的应用程序

在此输入图像描述

我的代码的清单文件

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android3.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity2"
            android:label="@string/app_name" >

        </activity>
        <activity
            android:name=".Sigin"
            android:label="@string/app_name" >
        </activity>
    </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

这是在单击Run-> Edit Congiguration时获取的窗口,在 此处输入图像描述

我的代码的Gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.example.mcs.oodoeg"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

        packagingOptions {
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/DEPENDENCIES'
        }

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile files('libs/xmlrpc-client-3.1.3.jar')
    compile files('libs/gson-2.2.2.jar')
}
Run Code Online (Sandbox Code Playgroud)

hta*_*oya 34

我有类似的问题,问题是设备.

当您卸载应用程序(在运行项目后再次安装),而不是实际卸载它时,它会将其停用.

这意味着,该应用程序仍然安装但它被操作系统阻止.

所以我无法运行该项目,也没有给出更多信息.(Activity launcher not found是唯一的消息)

有效删除应用程序(通过设备设置)解决了这个问题.

  • 这对我有用,谢谢。因此您只需转到“设置”&gt;“应用”&gt;“您的应用”&gt;“卸载”,而不是将其从启动器中拖动 (2认同)

use*_*896 6

当您仍在手机上对其进行测试时,删除该应用程序时会发生错误。该应用程序显示为已删除,因为它从启动器中消失了。要完全删除该应用程序,请执行以下步骤。

单击设置=>应用程序和通知=>应用程序信息=>找到应用程序的名称=>在右上角单击三个点=>为所有用户卸载后,它可以完美运行。


Vis*_*kar 5

如果您升级 android studio IDEA,请尝试此操作

File -> Invalidate Caches / Restart ... ref. 链接=> Android Studio 中未找到默认活动