Cannot start application in android studio emulator since 2.0 update - android

I recently (2 days ago) updated my Android Studio to version 2.0.
After having troubles with my previously working application on a real device, I had to activate MultiDex to remove errors in the logcat...
All is working fine now, as it was before the update.
But when I try to launch my application in the emulator from Android Studio (which was working before the update) I face a strange error without any explanation (this is from the Android Studio "4: Run" tab):
04/13 13:20:40: Launching app
No apk changes detected since last installation, skipping installation of /.../app/build/outputs/apk/app-debug.apk
$ adb shell am force-stop com.android.test
$ adb shell am start -n "com.android.test/com.android.test.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Unexpected error while executing: am start -n "com.android.test/com.android.test.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while Launching activity
(I replaced the entire location by /.../ in the above lines as this is not relevant to the problem...)
The strange fact is the application works perfectly well on the AVD if launched manually (by clicking on the application icon on the virtual device)!
Now if you guys have an idea of what is happening and how to get rid of it, it would be nice.
PS: I tried removing the MultiDex, nothing changed, facing same issue...

The new "instant run" feature is a bit buggy still, delete the app manually on your virtual device and run the code again.

Sorry for write on outdated post , but i had same problem. I was using AVD with arm processor image and received this same message.
The only way for me to make Android Studio 2.1.2 runs the app with instant run was change to a X86 processor image.

Related

After Android Studio 3.3 upgrade, so my APK's will build but not not run

After installing i get a Disconnected emulator-5556 message, while im running a different emulator (on 5554).. Even when i don't have any emulators of devices running!
I tried deleting all my AVD's
Wiping AVD data
adb kill-server && adb start-server
AS restart
Created a new user profile on my Mac to see if that helped..
Re-installed SDK Platform tools
When i launch my app via run. The device selector shows this. Is this way since a long time and didnt interfere with my work in AS 3.2. But after upgrading to AS 3.3 i cant run apps anymore
But nothing works, anyone ran into this issue before?
For if someone runs into this in a couple of years. I tried a couple of commands and the ghost emulator magically disappeared...
First command (to see if a process is doing something with adb)
ps aux | grep adb
Second command (to see if files are opened by a process)
lsof -nP -i4TCP: 5556 | grep LISTEN
Shouldn't have worked, but it stopped the blinking emulator for me..
No worries, just go to SDK manager and check if the Update is Available for the SDK Platforms, or SDK Tools. this usually happens when we use previous versions and sudden date to the new version of android studio and tools or platforms are not ready or updated with that version. Android has the version compatibility issues.image
I had the same issue after upgrading to Android Studio 3.3. In my case I had the Videostream app on my Mac and it was competing for port 5556. Uninstalling /Applications/Videostream and killing the process freed up port 5556 and everything started working for me again.

Error while trying to push/install .apk using adb

I've recently started encountering problems while trying to run my application from Android Studio on my MacOS machine. I tried to run the command from adb myself but I still can't get it to work, although the error appears different.
The errors I get are as follows;
Android Studio
10/02 09:54:53: Launching app $ adb push /Users/{username}/{path-to-apk}.apk /data/local/tmp/{package}
java.io.IOException: Broken pipe
Error while Installing APK
adb (via Terminal.app)
$ adb push /Users/{username}/{path-to-apk}.apk /data/local/tmp/{package}
adb: error: 65536-byte write failed:
Undefined error: 0
Now I've tried a lot of different things, some of which are just stretches because the problem appears to lie in something adb related, but none of this seems to change anything;
Different applications/apks
Different Android devices (total of 5)
Different USB-ports (all 4,
with and without USB-hub).
Different (or no) USB-dongles (USB-C to USB-A)
Restart/Invalidate Caches (Android Studio)
Reinstall Android Studio
Reinstall Android SDK
New (separate) install of Android SDK through homebrew
Reset NVRAM/PRAM
Reset SCM
Update to MacOS Mojave (and retry all of the above).
At this point I am at a loss. Has anyone encountered these errors before without having any of the above solutions fix it? Next thing on my list is a reinstall of the OS, but that feels like a bit of overkill.
I am running on MacOS Mojave on a 2016 Macbook Pro, but everything appeared to have the same effect on High Sierra.
Edit
Weird update on the behaviour, I can get the installing to work continuously after a restart by doing the following steps;
Login
Start Terminal.app
Manually repeat adb push command
(Command executes successfully)
Start Android Studio
Everything works fine...
However, if I start Android Studio without first manually doing the adb push in Terminal, everything is broken as described above.
Edit 2
Even calling adb start-server in Terminal before starting Android Studio makes everything work. So something appears to be faulty when Android Studio is responsible for starting the adb server..
I got the same error. I have no idea but start-server before starting Android-studio
Restart adb with the following command,
adb kill-server && adb start-server
Not really an answer but my issue appears to be solved with the latest release of Android Studio.

Trouble loading the skobbler map

I am trying to run the demo project by skobbler, however the app crashes the moment it starts. It runs the SplashActivity.java file which has the code to initialize the map. This is the output from on the run terminal:
Split APKs installed
$ adb shell am start -n "com.skobbler.sdkdemo/com.skobbler.sdkdemo.activity.SplashActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Connected to process 20422 on device Pixel_API_25 [emulator-5554]
Application terminated.
I am not able to figure out what's causing the app to crash. Is anyone facing similar issue?
Android intel emulator supports openGL now
Here you can choose which GL interface you want to use on your emulator.
On macOS you can see some information about the openGL running on the emulator. Once you have downloaded the additional tools for xcode.
For some more information about emulator hardware acceleration here.
There use to be some problems running skobbler in emulator. Try on a physical device.

Ignore INSTALL_FAILED_VERSION_DOWNGRADE when running application from Android Studio?

I know there is adb argument ("-d") to bypass the INSTALL_FAILED_VERSION_DOWNGRADE error, to be exact:
adb install -r -d
but I wanted to know if there is a way to do the same thing without manually installing an app through adb but from within Android Studio. So when I Run/Debug application I'd like to ignore the error that is informing about downgrading an application, I want it to be overwritten by an older version of an app I'm running (keeping all the application data ofcourse - that's the point).
Is it possible?

android emulator on eclipse won't open

I've gotten it to work before but now the android emulator on eclipse refuses to open. No new window, nothing. Most of the time the console says nothing when I tell it to launch, other times it says "The connection to adb is down, and a severe error has occured." but if I try again after waiting a bit it goes away then it says Launching.... and does nothing.
I try to delete the avds and it says they are currently running in emulators and cannot be deleted even though there are no windows open. I tried re-installing the (1.6) SDK and that didn't work.
Oh and I'm using Ubuntu
Edit The console is finally working, after complaining about adb, I ran it again and I got
"Launching a new emulator with Virtual Device "XXX" and then nothing
then I tried to launch a different project with the same emulator and got:
Automatic Target Mode: Preferred AVD "XXX" is not available. Launching new emulator.
Launching a new emulator with Virtual Device "XXX"
Run adb kill-server and then sudo adb start-server and then adb devices and see if you see the emulator. Sometimes the emulator is running but it hides somewhere. Also trying running the app in debug mode. Also the emulator can be just damn slow sometimes. adb is a command located in the sdk tools directory I think. Add it to your path and it will save you a lot of time. You can also do install and uninstall of your apps using command. Then tell us what you see.
I did have the same issue and I solved it by running the emulator from the command line. Go to the tools folder in the SDK package and start the emulator from there, use the name of the emulator you setup in Eclipse (in Virtual Device Manager):
./emulator -avd [the name]
The GUI should either come up (the GUI comes up fairly quick but will "idle" quite a bit) or you'll probably get an error on the command line. For me it was a missing library, namely libGL.so. Install a lib with apt-get containing libGL and retry.
sudo apt-get install libgl1-mesa-dev:i386
./emulator -avd [the name]
I did some googling and I'm not the only one, and of course those libs are missing in a 64 bit environment. Here's another one with the same problem.
Hope it helps!

Categories

Resources