Reputation: 81
Whenever I try running my application - this window in the screenshot is popping up in my screen. Stating that default activity is not found because of this I am not able to deploy my app:
Manifest file of my code
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mcs.oodoeg" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android3.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity2"
android:label="@string/app_name" >
</activity>
<activity
android:name=".Sigin"
android:label="@string/app_name" >
</activity>
</application>
</manifest>
This is what the window which I am getting while clicking the Run-> Edit Congiguration:
Gradle file of my code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.mcs.oodoeg"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.1'
compile files('libs/xmlrpc-client-3.1.3.jar')
compile files('libs/gson-2.2.2.jar')
}
Upvotes: 1
Views: 20568
Reputation: 667
All the answers above didn't help me. Renaming the activity worked for me. For example, ErrorActivity threw this error. ErrActivity - no.
Upvotes: 0
Reputation: 1561
Go to Run > Edit configuration and check this detail. Check this image
Upvotes: 1
Reputation: 7210
just find the application on your phone and Uninstall it.
and Clean the app and run it again.
Upvotes: 0
Reputation: 477
In my case the problem was due to the emulator which started in "safe mode" making impossible to run on the device, changing emulator device worked.
Upvotes: 0
Reputation: 21
it's studio setting problem. please click app => Edit Configrations => Deploy. select Default apk and apply.after click ok
Upvotes: 2
Reputation: 615
It's working perfectly for me after clicking on settings => Apps & notification => App info => find the name of the app => on top right corner click on the three dots => Uninstall for all users.
Upvotes: 4
Reputation: 67
I solved the issue by uninstalling the app on my device for other user.
when you run the app on your device installation will happen for every user on your device
uninstalling the app only uninstall it for the current user you are using on the device
Upvotes: 1
Reputation: 21
I faced the same problem.
Solved by going to the other user account on my phone and uninstall the app. Seems this problem is caused by first installing this app on "A" user account then we uninstall this app in "B" account. So when we try to run our app again in "B" account the old app is still exist in "A" account.
Upvotes: 1
Reputation: 97
The error occurs when you delete the app when you are still testing it on your phone. The app shows as deleted because it disappears from your launcher, To fully delete the app follow the steps below.
It worked perfectly after clicking on settings => Apps & notification => App info => find the name of the app => on top right corner click on the three dots => Uninstall for all users.
Upvotes: 6
Reputation: 19273
I had a similar problem, the issue was the device.
When you uninstalled the app (to install it again after running project), instead of actually uninstalling it, it deactivated it.
That means, the app was still installed but it was blocked by OS.
So I couldn't run the project, and no more information was given. (Activity launcher not found
was the only message)
Effectively deleting the app (going through device settings) solved the issue.
Upvotes: 34
Reputation: 2127
try this if you upgrade android studio IDEA
File -> Invalidate Caches / Restart... ref. link=> Default Activity not found in Android Studio
Upvotes: 5