Android Studio can not run or debug app on emulator - android-studio

I have a very odd situation here:
I just want to run and debug my app on the emulator.
I get
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.myapp"
pkg: /data/local/tmp/com.example.myapp
Success
The app is correctly installed on the emulator, but does not start up.
I can run and debug this app on USB-Device.
I can run and debug any other app on same emulator.
I tried different AVDs (arm and intel), SDK and Target
Build finishes with 0 errors and 0 warnings. Eventlog is empty. I cleaned the gradle file and changed the only dependency com.android.support:appcompat-v7:21.+.
I can start the app normally on the AVD by clicking on it's icon.
When I start debugging, app installs, then waits endlessly on:
Waiting for process: com.example.myapp
I do not even now where to start looking (of course I tried rebuilding, synchronizing and cleaning cache). I also tried changing the project name.

Maybe try making a new project and copying your code over?

Related

Problem processing route in Ember.js app when building and running app in Android studio emulator

Trying to build and run an Ember app with Capacitor on virtual device in Android studio. Build and installation goes fine until the app is launched and stops when trying to process a spesific route. The problem only occurs when building from windows, no problem on Mac. The app is communicating with a jsonapi.
Error message in chrome device inspector: "Error while processing route [routename]"
I have tried with physical device connected getting the same message. Also tried with Genymotion plugin.
Capture of browser console:
chrome console error
And this is what logcat is giving:
logcat error
I also have some errors reported from the IDE (Android Studio) not related to running the Emulator but occurs when opening the IDE:
Android Studio errors. In case this has something to do with it.
Solution in this case:
Had to reinstall node js with another older version. Did an npm cache clean and built the app all over again. Also made sure to open the project with npx cap open android.

Android Studio 3.4 waiting for application to come online

Since upgrading to AS 3.4 I can no longer debug any of my apps. I have made no changes to any of the projects, I just upgraded AS. Now all I get is "Waiting for application to come online".
When I click on Run->Attach Debugger To Android Process, there are no processes to attach.
The apps load and run, but I cannot debug them.
Is there anything I can do to get the debugger working?
(I have tried clean, rebuild, invalidate cache and restart, make project and gradlew clean).
I found the same trobles in Android Studio Dolphin (2021.3.1) when created a new project with no activity. After the project creation I created a main activity and add a launcher intent-filter and tried to debug it. And found "Waiting for application to come online". I found that "Launch" argument in "Lunch Option" for my "Run Configuration" is "Nothing". Problem solved by changing it to "Default Activity"
To change run configuration option select Run->Edit Configurations, or "Modify Run Configuration" in Run or Debug panel.
I had the same problem, I tried: Update Android studio to 3.5, restart cache, delete cache folders, killing adb server and restart it... but nothing works.
I solved executing the next commands on ADB terminal:
On windows, you have to change to platform-tools folder path in order to excecute ADB commands, something like this:
cd C:\Users\YourUser\AppData\Local\Android\Sdk\platform-tools
Then, compile your app on debug mode. (I think shift + F9 on Windows), when you started to see "Waiting for application to come online" message, execute the next adb command:
adb shell am start -n com.example.yourPackage/com.example.yourPackage.MainActivity -D
Just change com.example.yourPackage and make sure MainActivity its your Luncher Activity inside your Manifest File.

Android studio 1.5.1 cannot build

Lately, I encounter a lot of problems using Android Studio.
I'm using Android Studio 1.5.1, with gradle plugin 1.5.0 (corresponding to Gradle 2.2.1, I think), on Windows 7.
There is no update for Android Studio for now, and neither in standalone SDK manager.
Sometimes when I try to launch my app on an emulator, the builing process wont stop (I waited for 1 hour once...). Even after I quit the emulator and just build project on sync gradle, it launch a process that never ends. The log file is not writing and there is no error message anywhere.
For the process to end, I have to go to the taskmanager and stop every java.exe process I see, and it then shows this message :
Error:Unable to start the daemon process. This problem might be caused
by incorrect configuration of the daemon. For example, an unrecognized
jvm option is used. Please refer to the user guide chapter on the
daemon at https://docs.gradle.org/2.8/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
After that, not any build will succeed, and the only way for my project to successfuly build is to reboot my OS ! (even after taskkilling every known related task, like android64.exe, adb.exe, java.exe)
Is the bug known ? Is there any workaround ? Am I doing something wrong ?
Further details
When it bugs, the gradle console is writing
Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources]`.
, but then nothing. It's more that gradle is not working than it's stroking on one point. But there still is that java.exe process with its 66Mb of memory...
It bugs after approximately 8 successful runs.
Last updates
I know now the real troublemaker ! It is C:\Users\Me\.gradle\daemon\2.8\registry.bin
I can't even right click on it without crashing Windows Explorer !
I have been facing the same problem. However, I had a previous project which had been successfully built. What I did was - changed the location of Service Directory Path(the one pointing to the '.gradle' folder) of my new app to the Service Directory Path of the successfully built app, i.e from
C:/Users/YOUR USERNAME/AndroidStudioProjects/CURRENT APP/.gradle
to
C:/Users/YOUR USERNAME/AndroidStudioProjects/SUCCESSFULLY BUILT APP/.gradle
To change the service directory path-
go to settings --> Build, Execution, Deployment --> Build Tools --> Gradle --> service directory path

Android Studio Application doesn't start

I switched from Eclipse to Android. After a whole time all works. But:
If I'm click on RUN, the app won't start. I test with a real device. If I'm removing the App from the device and click on run, the app will be installed, but that was all. I have to click on it to open it.
I added a Android Application in my Run/Debug Configurations.
What I'm doing wrong?
EDIT:
Here is my Console-Output:
Waiting for device.
Target device: samsung-gt_i9100-000e3cc647f8cf
Uploading file
local path: myApkPath
remote path: remotePath
Installing application
DEVICE SHELL COMMAND: pm install -r "remotePath"
Make sure that in your build configuration, under 'General'->'Activity' you have selected Default Activity.
If you want to run a non-default Activity, it will have to be marked exported=true in AndroidManifest.xml.

Azure Development Fabric Logging Agent crashes on start

When I click debug in visual studio on an Azure project I keep getting the same following error every time:
In the background, the other parts do run and the emulator runs but none of the logging functions work. I am running a pretty clean Windows 8 install (downloaded from DreamSpark) with a clean Visual Studio 2012 Ultimate RC installed.
How can I fix whatever is going wrong?
I had the same problem and discovered that this seem to work
If I reboot and then start the azure emulator from the azure command prompt. Works fine.
If I then shut down and exit the taskbar icon and restart from the command prompt, I get the error again.
Checking the running processes, it seems that dfmonitor.exe does not terminate and continues running.
If I terminate dfmonitor.exe and then restart the emulator from the command prompt, it starts up fine without the error.
It started working suddenly without any changes made.

Resources