lschlessinger
lschlessinger

Reputation: 1954

Default Activity not found (Android Studio 0.6.1)

I just installed Android Studio 0.6.1 and imported a project from Eclipse. When I tried to run the project, I got Error: Default Activity not found.

I looked at these two StackOverflow questions:

As suggested, I tried to invalidate the caches + restart and make sure my AndroidManifest was correct. Both didn't work.

I also tried this solution, but to no avail:

Try to right click on the project and choose Open Module Settings. Then go to the Sources tab in your module, find the src folder, right click on it and mark it as Sources (blue color).

When I opened the module settings, there was no sources tab.

How can I fix this problem?
Is there there any equivalent of the sources tab in Android Studio 0.6.1?

Edit:

Here's the launcher activity

<activity
    android:name="com.lschlessinger.appname.activities.SplashScreenActivity"
    android:noHistory="true" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

I also tried cleaning my project, rebuilding my project, and restarting Android Studio, all of which, did not resolve the problem.

As a temporary solution, I'm manually selecting the launcher activity in the run configuration.

Upvotes: 1

Views: 8311

Answers (6)

mohit sharma
mohit sharma

Reputation: 1070

***************Simple Solutution**********************

This problem occurs because of caches. If You are using Android Studio. File---->Invalidate Caches/Restart. Click on it and choose Invalidate Caches/Restart.

Upvotes: 0

mbo
mbo

Reputation: 164

I encountered the same question. Finally I resolved the question.

My Manifest file is like this:

        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.DEFAULT" />

and it should be:

        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />

In the worst, if it cannot resolve you question, you can create a new activity and select as Launcher activity to see whether it's resolved.

It seems that you don't have any default activity. Create a new activity by File -> New ->Activity and select as Launcher activity.

Upvotes: 3

Andrey Novikov
Andrey Novikov

Reputation: 5593

In my case it was a third-party library with invalid Manifest which defined another main activity. As you know, Gradle combines Manifests, so my application contained two main activities. When I fixed library Manifest this error also gone.

Upvotes: 0

Suhail Bhat
Suhail Bhat

Reputation: 453

It seems that you don't have any default activity. Create a new activity by File -> New ->Activity and select as Launcher activity.

That should work.

Upvotes: -1

lschlessinger
lschlessinger

Reputation: 1954

Switch to Android Studio 0.8.+.

This fixed the issue.

Upvotes: 0

Blake G
Blake G

Reputation: 581

Perhads Build-> Clean Project, then Build-> Rebuild Project, then restart AS. source

Upvotes: -1

Related Questions