How to solve Android Error type 3?

五迷三道 提交于 2020-12-31 10:51:00

问题


Below manifest formation I am using into my project but whenever I am trying to run my emulator, I am getting below mentioned error. please give me a exact solution for solving the error.

Tools informations

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>

My Error :

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!

回答1:


try this

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

your Main Launcher activity always should be only ONE Activity.




回答2:


After searching it for so long what helped me was.

1) File -> Sync Project with Gradle Files.

Or

This helped me too.

2) Uninstalling the previous installed application from emulator/mobile and re-run it and install it again.




回答3:


I had to uninstall the app for all users.

If you have multiple users (e.g. a kids mode) on your device, uninstalling the app from homescreen only removes the app form the current user.

Go to Settings -> Apps -> (Your App) -> Open Popup Menu (by clicking on the three dots in top right corner) -> Uninstall for all Users




回答4:


Uninstall your app via 'adb' in the terminal: adb uninstall com.example.yourapp




回答5:


In build.gradle, the line:

 apply plugin: 'android-library'

needs changed to:

apply plugin: 'android'

Edit:

Solution is deprecated. Please use this:

apply plugin: 'com.android.application'



回答6:


Include the applicationId configuration in build.gradle if it doesn't already exist.

android {
    compileSdkVersion 18
    buildToolsVersion '19.0.0'

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



回答7:


The solution to my problem was to uninstall an app from the app (Settings) folder in android because the app was just disabled.




回答8:


I thing other solutoions will work fine for few user in my case i am using android 9 and i have multi user option enabled for system, it automatically install application for guest user, so goto
Settings>Apps>Concern App
And you will see uninstall for all user option at the top Option Menu. Uninstall and everything will work fine.




回答9:


in my case this error sparsely appears in one project only and I can resolve it only uninstalling the app. the simplest way is to use Gradle:

ProjName->Tasks->install->uninstallAll


来源:https://stackoverflow.com/questions/33339333/how-to-solve-android-error-type-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!