Debug run with AndroidTestOrchestrator stuck waiting for debugger - android-studio

When running an Espresso test with Android Test Orchestrator enabled the test runs fine without Debugger but when starting test with Debugger the test just hangs with the following logcat message:
I/AndroidTestOrchestrator: Waiting for debugger to connect...
The test also runs fine with Debugger attached if I disable Android Test Orchestrator.
Any ideas how to get this working or if this is a known issue?
Environment
Android Studio 3.1.3
Support Test Library version: 1.0.2
Target SDK: 27
Device under Test: Emulator API 27

Looks like this is a bug in Support Test Library 1.0.2 per https://issuetracker.google.com/u/1/issues/78658117.
I was able to workaround the issue by downgrading to 1.0.1 but also reset my emulator data before being able to Debug with Orchestrator.

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 4.1.1 Failed to connect port

I'm using Android studio 4.1.1 on a windows machine with gradle 6.5, NDK version=21.3.6528147 and SDK platform tools 30.0.5
When I try to connect a debugger I get "Failed to connect port" message with exit code 0. (maybe has something to do with lldb, since it's the last thing mentioned before the error message)
If I create a new simple project with empty project the debugger can connect and stop at breakpoints.
(My project is a project that I inherited so I don't know all the configurations.)
I tried looking as AndroidManifest.xml but the debugger is enabled. I also updated the NDK version to 30.0.5 (was 29 before) and even tried to update the adb driver just to make sure that it is not the problem. (I also reinstalled the Android sdk and made sure that the project is on debug and not release)
Since the debugger works in a simple app, I guessing it has something to do with the gradle or maybe a configuration that I'm missing.
Any suggestion will be appreciated.
Thanks.
First of all - you are using a physical device or emulator?
Simplest answer is that some other process uses a debugger port.
You can enumerate all connections by:
netstat -a -b
Change Run --> Edit Configuration --> Debug Type --> Change to Java. It work for me.

Flutter Integration Test run/debug configuration in Android Studio

I am trying to run/debug some integration tests on a flutter project. my tests are running fine when I run "flutter drive --target=test_driver/app.dart" on my project.
I am trying to create a Debug configuration in my Android Studio as per following steps in the StackOverflow answer-
How to automate Flutter Integration testing command?
however, when I try to run the test with this configuration I get the following error
Any pointers about how this can be resolved?
Removing Break points and Flutter clean did not yield any results
00:00 +0: Flutter Driver demo (setUpAll)
[info ] FlutterDriver: Connecting to Flutter application at http://127.0.0.1:55319/L_Bm--V4Kjg=/
[trace] FlutterDriver: Isolate found with number: 283666305
[trace] FlutterDriver: Isolate is not paused. Assuming application is ready.
00:00 +0 -1: Flutter Driver demo (setUpAll) [E]
JSON-RPC error -32601 (method not found): Method not found
package:json_rpc_2/src/client.dart 110:64 Client.sendRequest
package:json_rpc_2/src/peer.dart 68:15 Peer.sendRequest
package:vm_service_client/src/scope.dart 64:23 Scope.sendRequestRaw
Run Configuration is as follows
Checking the logs and your setup, the run config is fine and works without issues. The issue here is caused by a "Method not found" error thrown by json_rpc_2. Trace where the error is thrown from your test, and see if this could just be an unhandled Exception that causes the issue.
Another workaround here is to set up flutter drive as an External Tool, and configure created External Tool to run 'Before launch'. Note that the path set on 'Program' points to the Flutter SDK.
This works well for me, and using this approach, you won't need to set a VM_SERVICE_URL Environment for your flutter drive run config.

React Native Could not create ADB Bridge Error

JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Download https://jcenter.bintray.com/com/facebook/react/react-native/0.20.1/react-native-0.20.1.pom
....# a bunch of downloads here
:app:assembleDebug
:app:installDebug
05:13:20 E/adb: Unable to obtain result of 'adb version'
:app:installDebug FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:installDebug'.
com.android.builder.testing.api.DeviceException: Could not create ADB Bridge. ADB location: D:\Android\sdk\platform-tools\adb.exe
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I'm using Windows machine and the android studio and have followed the tutorial over at
https://facebook.github.io/react-native/docs/getting-started.html
I'm stuck at this as i cannot run the 'react-native run-android' on command prompt
Also, running adb version gives
Android Debug Bridge version 1.0.32
Revision eac51f2bb6a8-android
I have solved this problem ..if you are using emulator then follow React-Native, Android, Genymotion: ADB server didn't ACK... if you are using your device over usb for development then it is an error of your adb path.. set the path to D:\Android\sdk\platform-tools... in pc properties->advanced settings->environment variables->system variables..it worked for me.
I have another solution, If you are using emulator then make sure its running before you start you react native app. Some time you may need to close the application(like skype) those are using same port:8081(default used by react native application) before running react native app.

Android Studio can not run or debug app on emulator

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?

Resources