如何解决Android错误类型3?

时间:2015-10-26 06:00:54

标签: android android-manifest

在我的项目中使用的清单形式,但每当我试图运行我的模拟器时,我得到下面提到的错误。请给我一个解决错误的确切解决方案。

工具信息

Android studio 
Nexus S API 22 (android 5.1.1)

My Manifest file formate

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

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="app"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >

        <!-- Splash activity -->
        <activity
            android:name=".SplashActivity"
            android:label="app"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">

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

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

        <!-- Login activity -->
        <activity
            android:name=".LoginActivity"
            android:label="app"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
        </activity>

        <!-- List activity -->
        <activity
            android:name=".listActivity"
            android:label="app"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
        </activity>
    </application>

</manifest>

我的错误:

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.info.androidapp/.SplashActivity }
Error type 3
Error: Activity class {com.example.info.androidapp/com.example.info.androidapp.SplashActivity} does not exist.

NOTE : Sometimes I am facing Unfortunately, the process com.android.phone has stopped alert into emulator!

9 个答案:

答案 0 :(得分:6)

在终端adb uninstall com.example.yourapp

中通过“ adb”卸载应用

答案 1 :(得分:4)

在build.gradle中,行:

 apply plugin: 'android-library'

需要改为:

apply plugin: 'android'

修改

不推荐使用解决方案。请使用此:

apply plugin: 'com.android.application'

答案 2 :(得分:4)

搜索了很长时间后,对我有帮助的

1)文件->使用Gradle文件同步项目。

这对我也有帮助。

2)从模拟器/手机上卸载先前安装的应用程序,然后重新运行并再次安装。

答案 3 :(得分:1)

试试这个

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

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="app"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >

        <activity
            android:name=".SplashActivity"
            android:label="app"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">

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

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

        <!-- Login activity -->
        <activity
            android:name=".LoginActivity"
            android:label="app"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">

        </activity>

        <activity
            android:name=".listActivity"
            android:label="app"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">

        </activity>
    </application>

</manifest>

您的Main Launcher activity始终应该只有ONE Activity

答案 4 :(得分:1)

我必须为所有用户卸载该应用程序。

如果您的设备上有多个用户(例如儿童模式),则从主屏幕卸载应用程序只会从当前用户中删除该应用程序。

转到设置->应用程序->(您的应用程序)->打开弹出菜单(通过单击右上角的三个点)->为所有用户卸载

答案 5 :(得分:1)

就我而言,此错误仅在一个项目中很少出现,我只能通过卸载应用程序来解决。最简单的方法是使用Gradle:

ProjName->Tasks->install->uninstallAll

答案 6 :(得分:0)

如果build.gradle尚未存在,请在 applicationId 配置中包含。

android {
    compileSdkVersion 18
    buildToolsVersion '19.0.0'

    defaultConfig {
        applicationId 'com.myapp.app'
        minSdkVersion 11
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
}

答案 7 :(得分:0)

我的问题的解决方案是从Android的应用程序(设置)文件夹中卸载应用程序,因为该应用程序刚刚被禁用。

答案 8 :(得分:0)

在我使用android 9的情况下,我认为其他解决方案对于少数用户也可以正常使用,并且我为系统启用了多用户选项,它会自动为来宾用户安装应用程序,因此goto
设置>应用程序>关注的应用程序
您会在顶部的“选项菜单”中看到“为所有用户卸载”选项。卸载,一切都会正常。