I am currently running into this issue without even knowing why.
It was working fine yesterday and I just added more code to each activity.
I have already perfomed "Invalidate Cache/Restart" and Restarted my computer.
Note that I did not change anything in the Manifest.xml nor have I added a new activity to the Project.
Here's the AndroidManifest.xml file.
<?xml version="1.0" encoding="utf-8"?>
<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=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".RegisterActivity" />
<activity android:name=".MainScreenActivity" />
<activity android:name=".StatisticsActivity" />
<activity android:name=".UnlockablesActivity"></activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
Any help would be greatly appreciated.
Edit: I have already tried to Rebuild and Clean multiple times. Same error.
The error is a little pop-up on the left corner saying "Error running app: Default Activity not found".
When setting the Default Activity in the settings to Nothing, this error appears in logcat when accessing a different activity.
It is not the full log but you can see that it references Line 25 in LoginActivity (the supposed Default Activity) which leads to its onCreate() function.
I've had exactly the same error a week ago, here's the link to my question. I couldn't find the origin of the error, it is probably a bug with Android Studio (I've had the same thing with all my projects).
I've resolved it by deleting the .AndroidStudio hidden directory in your user folder. Keep in mind, it deletes all the settings you've set before and it will reset Android Studio from scratch.
This is my first time out on the site and also with Android studio, so admittedly, these may be very simple answers that I'm missing but I've got a couple problems going on and I think they're all related. First, Android studio doesn't recognize the glass when it's plugged in via usb. My computer recognizes it and I can find it in the device manager and it says it has the most up to date drivers installed. I emailed support and got back some code I had to insert into AndroidManifest.xml which I inserted but, still Android Studio can't find it.
I've been looking around online quite a bit and it looks like every project is supposed to have an activity_main.xml file under app/src/main/res/layout but I don't have this folder or file at all. Is that a problem and if so, can I just insert a folder and/or file? Would I need to rebuild the project again for it to be usable?
Also, when it tries to build it immediately gets hung up and the error is 'The markup in the document preceding the root element must be well informed. I don't have any idea what this means or how to fix it. Perhaps this has something to do with not having an activity_main.xml?
This is what I've got in the Android Manifest
<<<<<<<Original<manifestxmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.admin.helloglass">
<application
android:allowBackup="true"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="#style/AppTheme">
</application>
</manifest>
=======<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT"/>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:icon="#drawable/ic_glass_logo">
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
<action android:name="android.intent.action.MAIN"/>
<category android:name="com.google.android.glass.category.DIRECTORY"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger" />
</activity>
</manifest>>>>>>>> Added
Thanks for your help.
I'm new to android and I have encounterded a problem.
The console said that "Could not identify launch activity: Default Activity not found".
I have add
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
in manifests.
And I have tried Invalidate caches/Restart,still not worked.
And the class file which contains the main activity turn green in android studio. I don't know what that means.
This is my manifests file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mrrobot.mycoolweather" >
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<Activity android:name="com.example.mrrobot.mycoolweather.activity.ChooseAreaActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</Activity>
</application>
</manifest>
The chooseAreaActivity is the one I want to use as launcher activity.
For main activity in your manifest you have to add this with category LAUNCHER (First Activity on launch app):
<activity
android:name=".MainActivity"
android:label="YourAppName"
android:theme="#style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
For other activity you have to change category to DEFAULT:
<activity
android:name=".OtherActivity"
android:theme="#style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="package.OtherActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Check this Activity and this Start Another Activity
So your code is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mrrobot.mycoolweather" >
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity
android:name=".activity.ChooseAreaActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Although the question is kind of outdated, I would add the following to all the given answers:
For multi-module projects check carefully that you modify the Manifest corresponding to the Configuration you are trying to run.
Had the same problem and spent 20 minutes just to discover that I was trying to run wrong configuration (with an Application in ModulbeB, while thinking that I was running one from ModuleA).
And sometimes you are working on other module default runnable module changes so you have to change it.
Sometimes it is solved just restarting Android Studio
I had the "Default Activity not found" problem a couple of times and I could solved restarting my android Studio.
If you see that error occur after upgrading your IDEA, upgrading Android Studio version, or Generating a new APK, you may need to refresh the IDE's cache.
File -> Invalidate Caches / Restart...
In your manifest file there was wrong element name (Activity change to activity) declared
<Activity android:name="com.example.mrrobot.mycoolweather.activity.ChooseAreaActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</Activity>
Change it to:
<activity android:name="com.example.mrrobot.mycoolweather.activity.ChooseAreaActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
When I upgraded Android Studio to 2021.1.1.23 somehow my Run Configuration was switched from app to models, producing this error. Switching back to app resolved the issue for me.
i had these issues with my project:
Default activity not found
xml intellisense was not working
kotlin standard functions were not detecting
All my above issues were resolved by Deleting System cache of Android Studio 3.3 at the home path, and it's working nicely for me,,
Steps:
exit Android Studio
Go to path > C:\Users\YOUR_WINDOW_USER_NAME.AndroidStudio3.3\system
Then you have a \caches folder, delete this caches folder
Now open Android Studio and load your project
Worked for me.. i wasted couple of hours resolving this issue and finally it got resolved in this way.
Exit your android studio IDE. Then locate the "caches" folder in .AndroidStudio3.2 folder.
Location
C:\Users\YOUR_USERNAME\.AndroidStudio3.2\system\caches
For example.
Let's assume say YOUR_USERNAME is called Admin.
C:\Users\Admin\.AndroidStudio3.2\system\caches
Delete the caches folder and start your android studio IDE.
I have tried solutions here and other questions
clean & rebuild & invalidate and restart
make sure that activity has LAUNCHER as category
delete Android cache folder
at End, activity tag was has <activity android:name="com.exmaple.todo.MainActivity" />
when i changed it to <activity android:name=".MainActivity" /> app worked.
I hope it help you if other solution not work.
If your activity is in a different module (e.g. ':library) und you forgot to specify the subproject in the dependencies{} scriptblock of your :app module,
the manifest of :library and therefore the activities it declares, are not imported.
dependencies {
api project (':library')
You may check whether all activities show up in your app-debug.apk by using the following Android Studio menu command:
->Build->Analyze APK->app-debug.apk
Now open the AndroidManifest.xml and check its activity declarations.
I got this error in android 12+ after changing launch activity adding intent-filter but not make it exported.
so not forget.
android:exported="true"
It is likely that the action is not in the manifest.
This is the fix
Attached is an image
My main activity was not declared in Android Manifest File. That's the reason which came that error. This error come because of a declaration problem of Android Manifest file. Please check it. :D
This happened to me aswell took me ages to figure out why, but a weird bug I spotted is that if you run the app with breakpoints in your code without debugging mode it will cause this error to happen.
Quick fix for now: Only use breakpoints for degbugging mode.
Check your duplicate initialize activity in your AndroidManifest.xml
Like bellow:
<activity android:name=".nim.qiaqia.lota.LotaProduct"/>
<activity android:name=".nim.qiaqia.lota.LotaOrderDetail"/>
<activity android:name=".nim.qiaqia.main.activity.RechargeListLotaActivity"/>
<activity android:name=".nim.qiaqia.lota.MiningCoinLota"/>
<activity android:name=".nim.qiaqia.lota.LotaOrderDetail"/>
that can causes ""Default Activity not found" also. So, remove it and see. its works! :)
In my case android manifest was correct. I tried to invalidate Caches and restart but not worked. Then Rebuild project and it also did not work.
Then I realized that last night I added a new library to build Gradle, it was this:
implementation 'com.yalantis:eqwaves:1.0.1' And after removing this everything worked fine.
TIP: "Always have a track of things you do in your project, otherwise you will end up wasting your time"
If you only enabled building the app via app bundle, then this error might also occure when you try installing it as a default APK. Change the deployment option to APK from App Bundle and you are good to go.
I have scoured the internet for this, but none of the "answers" I have found so far have fixed it for me. My app installs and runs 100% on my phone, which runs Android 4.1.2. It appears to install ok on my tablet too, which runs Android 4.3. But when I try to run it on the tablet, I get the "Application is not installed" error. What is even stranger is that if I run it using the App Manager inside ES File Explorer, it runs fine!
So my suspicion is that Android 4.3 is more strict about something that 4.1.2 lets through. But what? I just can't find it. And why it should run from within ES File Explorer is just weird. The app manifest is below. I have tried several different values for the target SDK, but nothing makes any difference. The app is signed using the Export Wizard in Eclipse, using a certificate created there.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="marshallarts.wordfinder"
android:versionCode="10"
android:versionName="1.10" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:permission="android.permission.WRITE_EXTERNAL_STORAGE"
android:theme="#style/AppTheme"
android:hasCode="true" >
<activity
android:name=".StartActivity"
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=".EnterActivity"
android:label="#string/title_activity_enter"
android:theme="#android:style/Theme.Dialog">
</activity>
<activity
android:name=".PlayActivity"
android:label="#string/title_activity_play" >
</activity>
</application>
</manifest>
Would add as a comment but don't have enough rep at the moment.
Have you changed your default launcher activity in your project recently? It could be that the link in your Android Home application is referencing the old activity.
Well I have solved this at last. It was (of course) my error - I had not correctly understood how to specify the app's permissions, and had not set them properly in the manifest. Corrected that, and it now runs happily. It is still a minor mystery why it ran on my phone - seems to me it should not have - but no matter, I am now on the right track.
I have an android app. (built for 1.5) while installing it on my device it creates no error, but while running it, it says "the application is not installed in your phone"..
can any one help me...?
I have tried this installing after uninstalling it for many times...
Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.testapp"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:label="#string/app_name" android:name="WelcomeScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="Untitled1"></activity>
<activity android:name="Welcome"></activity>
</application>
</manifest>
Have you got your package name correct? It will be looking for a different application if your package name in the Manifest does not match that of your project
Its an application error. In application there is an manifest file in which we pass two actions ACTION_LAUNCHER and ACTION_MAIN which is not write there thats why this application says "the application is not installed in your phone" please verify from the android developer of this application. IF you have manifest file of this please write down here. i will correct this.
If this answer is useful to you then please tick that this answer is useful to you.
Who or what tells you "is not installed"?
If you have a shortcut on the home screen, this may become stale and you can get this message.
Try going to the list of apps and starting it from there.
I also see potential that the "com.android.*" package you show is causing issues, as this package may be reserved (at least it is not good practice to use it).
Issue solved,
I just copied and deleted the below lines from the manifest file and pasted it again in the same place ...
I dont know how it solved the issue but it just solved it....
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:label="#string/app_name" android:name="WelcomeScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>