Error type 3 - Activity class does not exist

2019-05-08 05:45发布

问题:

I'm trying to run webRTC application but the error below returned:

Launching application: com.onlinevoicecallapp/com.onlinevoicecallapp.MainActivity.

DEVICE SHELL COMMAND: am start -n "com.onlinevoicecallapp/com.onlinevoicecallapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.onlinevoicecallapp/.MainActivity }

Error type 3 Error: Activity class {com.onlinevoicecallapp/com.onlinevoicecallapp.MainActivity} does not exist.

When I searched for it I found many solutions but none of them works in my case, please advice!

Below is my AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>

<!-- WebRTC Dependencies -->
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<!-- PubNub Dependencies -->
<!--<uses-permission android:name="android.permission.INTERNET" />-->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="your.package.name.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="your.package.name.permission.C2D_MESSAGE" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_pubrtc"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.onlinevoicecallapp.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.onlinevoicecallapp.VideoChatActivity"
        android:label="@string/title_activity_video_chat"
        android:parentActivityName="com.onlinevoicecallapp.MainActivity"
        android:windowSoftInputMode="stateHidden"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.onlinevoicecallapp.MainActivity" />
    </activity>
    <activity
        android:name="com.onlinevoicecallapp.IncomingCallActivity"
        android:label="@string/title_activity_incoming_call">
    </activity>
    <activity
        android:name="com.onlinevoicecallapp.LoginActivity"
        android:label="@string/title_activity_login" >
    </activity>
</application>

回答1:

I ran into this after manually uninstalling an old debug build. The app somehow got into a strange state where it was still installed, but "installed for another user". I had tried doing a clean build with no luck. This finally fixed it for me:

  1. Go into the application list and find the app. For me it was "installed for other users".
  2. Select "uninstall for all users" from the top-right menu.

After doing this I was able to deploy debug builds to the phone normally.



回答2:

Probably an old version of the app wasn't uninstalled correctly.

When I uninstalled an app from the launcher on my LG G5, it still existed in >Settings>Apps but marked with "Deactivated".

I did have to uninstall it from >Settings>Apps to really delete it. Afterwards I was able to install and run the app again.



回答3:

I discover that there was something wrong with the android studio, I haven't found the root cause of the problem yet, but the problem was fixed by uninstalling the android studio and install it from another source.



回答4:

May you have installed the app in your android ,try to uninstall it by adb commend "adb uninstall com.onlinevoicecallapp"