android studio 3.2 default activity not found

2019-04-10 12:59发布

Recently I updated my android studio to 3.2 but when the old open project I getting the error "default activity not found".

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

<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=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

10条回答
看我几分像从前
2楼-- · 2019-04-10 13:36

File ->Invalidates Cache / Restart Solved my problem

查看更多
地球回转人心会变
3楼-- · 2019-04-10 13:37

I solved the very same issue by doing this

Close Android Studio

deleting :

1 .android

2 .AndroidStudio

3 .gradle

from C:\Users\[your user name]

Start Android studio ( Will take some time to rebuild)

查看更多
乱世女痞
4楼-- · 2019-04-10 13:42

None of the given solutions worked for me. The thing that worked for me was:

  • Exit Android Studio
  • Find AndroidStudio3.2 (or whatever your version is) folder
  • Go to AndroidStudio3.2 -> system -> caches
  • Delete that folder
  • Restart Android Studio

It will re-index your files and that thing will work

查看更多
聊天终结者
5楼-- · 2019-04-10 13:44

It worked for me by adding the default activity in the configuration, Following these steps:

1- Select Edit Configurations from the drop down next to run button.

2- Under launch options > Launch select Specified activity.

3- Another field "Activity" will appear select your default activity.

4- Click OK and sync project with gradle files and it should work.

查看更多
登录 后发表回答