I build and run my project by clicking the green arrow on android studio, my app should be launched automatically but it just installed then nothing happened.
I've tried reinstall android studio and create a new project but it still not fixed.
This is my Run/Debug configuration (Just the default setting).
This is the android manifest
<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>
I found the error message as below, why it disconnects?
04/20 16:37:14: Launching app
$ adb install-multiple -r -t [my project path]\app\build\intermediates\split-apk\debug\slices\slice_2.apk [my project path]\app\build\intermediates\split-apk\debug\slices\slice_8.apk [my project path]\app\build\intermediates\split-apk\debug\slices\slice_7.apk [my project path]\app\build\intermediates\resources\instant-run\debug\resources-debug.apk [my project path]\app\build\intermediates\split-apk\debug\slices\slice_9.apk [my project path]\app\build\intermediates\split-apk\debug\slices\slice_5.apk [my project path]\app\build\intermediates\split-apk\debug\dep\dependencies.apk [my project path]\app\build\intermediates\split-apk\debug\slices\slice_6.apk [my project path]\app\build\intermediates\split-apk\debug\slices\slice_0.apk [my project path]\app\build\intermediates\split-apk\debug\slices\slice_1.apk [my project path]\app\build\intermediates\split-apk\debug\slices\slice_4.apk [my project path]\app\build\intermediates\split-apk\debug\slices\slice_3.apk [my project path]\app\build\intermediates\instant-run-apk\debug\app-debug.apk
Device emulator-5556disconnected, monitoring stopped.
Split APKs installed in 1 s 572 ms
Lunch options > Launch > select as default Activity
Happy coding !!!
It caused by chrome extension - VideoStream, it using the same port 5556 as adb. Just terminate or uninstall it then work fine.
ref.
https://stackoverflow.com/a/54660175/4557420
https://stackoverflow.com/a/54731956/4557420
Related
Hi I have installed Android studio correctly. I made AVD for e.q Marshmallow and project on the same platform. after press RUN, AVD turns on. I can do everything on emulated android phone(other issue- after running this my computer dramticly slowing down) but I should see my "Hello world" app, there is not there. I'm getting following error
Unexpected error while executing: am start -n "com.example.zad2/com.example.zad2.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while Launching activity
where zad2 is my project name.
On Stacfoverflow i saw tips to add into manifest some filter code but I already have it:
<?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/Theme.Zad2">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Yea don't trouble friends. I found this post: Session 'app': Error Launching activity
and I unistalled my app from AVD :)
I installed android studio in a usb flash drive because i work on different computers and i don't always wanted to install it. Recently i started it on an
computer that just a week ago worked but when i run the project the IDE try to
run an activity that i've deleated in other computer. I have tried to
rebuild the project, delete the .idea and .gradle folder, disable instant run. Nothing of those success. What can i do?
Error message:
Error while executing: am start -n "bonfra04.com.application/bonfra04.com.application.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=bonfra04.com.application/.MainActivity }
Error type 3
Error: Activity class {bonfra04.com.application/bonfra04.com.application.MainActivity} does not exist.
Error while Launching activity
Now MainActivity does not exist any more.
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="bonfra04.com.application">
<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/GameTheme">
<activity android:name=".Launcher">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Game"></activity>
<activity android:name=".ScoreViewer"></activity>
</application>
Directory structure:
In Android Studio at the left of the green Run button, drop down the "app" list and press "Edit Configurations". In the "General" tab check the "Launch options". You must see "Default Activity". If not select it and click OK.
Check your manifest, I bet this activity is still defined as a launcher activity.
I have installed a new setup of adb-bundle. When I run the project apk installed on device/emulator but not opens automatically. This problem is not related to coding I this it is related to eclipse setup because it happens with all projects. Please Help. Facing issue with debugging due to this problem.
Manifest.xml:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.demo.MainActivity"
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>
Thanks
It seems like you have a problem with the adb. Open task manager and kill the adb process and restart everything and try again. If you have made some changes to the installed adb try to install it again properly.
Check the below links also,
https://lesleyharrison.wordpress.com/2011/01/15/solution-for-android-emulator-starts-but-app-doesnt-run/
Android application doesn't start from Eclipse
I get ClassNotFoundException when I try to debug my application on Eclipse. I'm using an Asus Transformer Pad TF300T with android version 4.1.1 at my home computer. Doing the same thing on my work computer but with a Samsung Galaxy 10.1 with android version 3.2 everything works fine. This is the message I receive:
11-22 09:15:14.313: E/AndroidRuntime(2609): FATAL EXCEPTION: main
11-22 09:15:14.313: E/AndroidRuntime(2609): java.lang.RuntimeException: Unable to get
provider com.company.bill.contentprovider.BillProvider:
java.lang.ClassNotFoundException: com.company.bill.contentprovider.BillProvider
Names has been changed to protect the innocent ;)
I'm guessing that there is some problem with my environment but I haven't been able to figure out why. On my Assus I turned on the development options, USB debugging, Stay awake and allow Unknown Sources.
I have tried turning of the break point for ClassNotFound in eclipse but it doesn't change anything. I have also tried running eclipse as admin but it didn't help.
I got Eclipse Juno and windows 7 64-bit.
EDIT:
manifest file
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" android:theme="#android:style/Theme.Light" android:testOnly="false" android:debuggable="true">
<activity android:name=".LoginActivity"
android:label="#string/app_name" android:screenOrientation="landscape" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
did you add your activity declaration to your manifest file ?
I was able to fix it my self.
I downloaded the Android Support Library using Android SDK Manager and that fixed it.
try this way...
Right click on your project and go to Properties.
go to java build path..//which is on the 5th position on left side
go to Order and Export tab.
check(Tick Mark) on your selected jar file. and click ok.
Now, clean your project and Run.
I developed an Android project in the package:com.anand.eprint.
The package contains ePrintActivity.java and GmailSender.java. The ePrintActivity calls GmailSender internally. This is working successfully.
I exported the project, taken backup and formated the system.
Now I installed new OS, eclipse and android environment.
Imported the same Android project into eclipse.
Now I am trying to install and run in Emulators/Android Phones.
I am getting error: ClassNotFoundError:GmailSender.
Please anyone help me ?
Follow these steps.
Right click on project > Android Tools > Fix Project properties
Project > Clean
That or you need to add the declaration of the activity in the manifest.
<activity
android:label="#string/app_name"
android:name=".ePrinterActivity" >
<intent-filter >
</intent-filter>
</activity>
<activity
android:label="#string/app_name"
android:name=".GmailSender" >
<intent-filter >
</intent-filter>
</activity>
Take out .GmailSender if its not an activity.