0
votes

I am developing android app but I am getting following error when I am running code in the emulator

error while executing: am start -n "yodgobekkomilov.edgar.com.githubapi/yodgobekkomilov.edgar.com.githubapi.SearchActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=yodgobekkomilov.edgar.com.githubapi/.SearchActivity } Error type 3 Error: Activity class {yodgobekkomilov.edgar.com.githubapi/yodgobekkomilov.edgar.com.githubapi.SearchActivity} does not exist.

Error while Launching activity

below my manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="yodgobekkomilov.edgar.com.githubapi">
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name="yodgobekkomilov.edgar.com.githubapi.SearchActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

        <activity android:name=".NextActivity"
            />
        <activity android:name=".MainActivity"/>



    </application>

</manifest>

below package structure of my apppackage structure

2
make sure your activity name i think you added in manifiest is your packagename activity name is which is in your java files name.yuvrajsinh
@yuvrajsinh I have added as the same package nameEdgar Shvedskiy
after doing <activity android:name=".SearchActivity"> in manifiest still gatting same error???yuvrajsinh
yes the same errorEdgar Shvedskiy
try to clean the project go to file and choose invalidate catches and restartBlack mamba

2 Answers

0
votes

Replace it

 <activity android:name="yodgobekkomilov.edgar.com.githubapi.SearchActivity">

with

<activity android:name=".SearchActivity">
0
votes

This is how i fixed it. go to gradle > Tasks > Install > UninstallAll

enter image description here