7
votes

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>

11
I found that this problem happens not only for webRTC, but also for every project I create!L.M.O

11 Answers

10
votes

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.

9
votes

I think the problem is you have already the same app under the different user which can be deleted by going to

  • Setting > All Apps > Your App > Uninstall for all user

If the problem still persists you should try it from ADB itself to uninstall it with command on your terminal.

adb uninstall yourpackagename 
6
votes

For me the solution was go to Gradle > Tasks > Install > UninstallAll

1
votes

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.

1
votes

The only thing worked for me is, I changed the testing device from LG to Samsung and it started working for me. The same issue is observed more often on LG devices than any other devices.

0
votes

I also faced this same error. This occurs to me when I moved launcher activity to some other folder.

But Internally Android studio was looking file at previous path.

I cleaned the project many time, but error was still there.Finally Just by doing one step error is gone.

I solved this error by restarting Android Studio and opening project again.

Thanks

0
votes

Tried almost all solutions given above. The error was still there. Then I just restarted the Emulator and it worked.

0
votes

In my case the emulator was in safe mode

restart the emulator and voila. NB restart to remove it from safe mode

0
votes

This is how I fixed the problem. Go to Run -> Edit Configuration-> and then check Install for all users checkbox.

enter image description here

-1
votes

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.

-1
votes

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