Android Auto DHU - Waiting for phone - android

I'm trying to run desktop head unit on my pc. I set up everything exactly as this guide specifies: https://developer.android.com/training/cars/testing, (tried both 2.0 and 1.1 with the same result). It appears to connect correctly, but I can't get it do display anything other than "Waiting for phone". Console displays following:
Android Auto - Desktop Head Unit
Build: 2020-09-20-332761970
Version: 2.0-windows-beta
[W]: No configuration specified - using default values.
[E]: Could not load configuration from 'C:\Users\kkowalczyk\.android\headunit.ini'.
BoringSSL is the SSL implementation used in the receiver-lib.
Starting link. Requested protocol version: 1.6 (snapshot 314970161)
[I]: Connecting over ADB to localhost:5277...
[I]: connected.
> Phone reported protocol version 1.6
ssl state=TLS client read_server_hello -1
ssl state=TLS client process_change_cipher_spec -1
ssl state=SSL negotiation finished successfully 1
SSL version=TLSv1.2 Cipher name=ECDHE-RSA-AES128-GCM-SHA256
Verify returned: ok
I'm trying to connect to Pixel 5 (with most recent update), is there anything else I can try?

In my case, I also saw the same issue but resolve by following below steps:
Close the DHU emulator.
In the AA app, stop the HU server. Wait for a couple of seconds, start the HU server.
Stop the HU server again. Wait for a couple of seconds, start the HU server.
Start the DHU emulator.
The OOBE screen shows up on the AA app in phone. Complete the flow. While you are completing the flow, the emulator will be on the 'waiting for phone' screen.
Stop and start the emulator. It will start with the black screen with 'waiting for phone' message but after 2-3 seconds the emulator screen comes up.
Hope it can resolve your issue too.

I ran into the same issue (stuck on the "Waiting for phone..." screen) and was able to fix it by changing Application Mode to Developer on the Developer Settings screen of Android Auto.
Make sure to restart the head unit server on the phone after that in case it was already running, then reconnect/restart desktop-head-unit.

I ran into similar issues initially and for me the issue was that the "Accept terms" screen of the Android Auto App running on the device that is triggered on connecting to the Emulated HUD was not visible and noticed until I scanned through the recent apps in the Task Switcher.
This is mentioned in step 11 of the Test Android apps for cars - DHU setup instructions here
If this is the first time you are connecting the mobile device to the DHU, check the mobile device's screen to accept the terms of service and adjust permission settings as needed.
So just note that this screen may not be immediately visible to you unless you switch the relevant screen from the Task Switcher.

Try to test your phone on a real car to make sure phone actually works with Android Auto. I have two phones (Huawei p20 and Xiaomi Mi10): xiaomi works fine but p20 doesn't work with multiple settings and/or option neither in car or DHU, however both of them are considered as compatible with Android Auto.

Related

Failed to publish the request over MQTT - Flutter - Parse Server

I have a sample app that uses Parse Server. I've been testing my app on both emulator and physical devices and I noticed that the response time is much slower on the physical device.
This one is from the emulator.
and this is one is from the physical device:
I've been scratching my head regarding this one. I've also posted it on the parse community platform and followed the advice there to manually monitor the server for every change I've made until I reach my prior server configuration. I overhauled the server from scratch. Do some load testing -> Deployed the server on a replica set -> load testing. Now, I'm in the process of doing some basic queries. I used ADB logcat to see what's happening on both device and saw these errors on the physical device and not on the emulator:
E[N rtchannel]_rt_mqtt_publish_callback(356)=>Failed to publish the request over MQTT. token:be925eea-407c-417d-96c9-3af5a7e83e48, category:mcd-sync-data-task-category, requestId:54138, error:Error Domain=mqtt Code=3008
E[S sync]_createResponseError(166)=>Network Response be925eea-407c-417d-96c9-3af5a7e83e48 contains sync error Error Domain=mqtt Code=3008 - Underlying error (null): Error Domain=mqtt Code=3008
This one also shows before pulling the payload.
W[S sync-state-machine]MCDSyncStateMachineScheduleDelayedRetry(173)=>skipping the new retry with longer delay
W[S sync]_scheduleNextCursorRetry(326)=>skipping delayed retry due to state machine state decision
The number of times these errors pop up is related to the number of queries executed. I did not put any configurations on the server which use MQTT. Any help is much appreciated.

chromedriver not reachable after close and launch app. WebDriverException

I made test which close mobile app and after 2 seconds launch it.
self.welcome_page.confirm_continue()
self.driver.close_app()
sleep(2)
self.driver.launch_app()
sleep(1)
after than I get WebDriverException for every interaction with driver. (e.g. find_element, current_url, refresh ...)
On the screenshot and in the video I see that the app is in expected state and obviously launched successfully.
I am running tests against BrowserStack. with following BrowserCapabilities
[Android]
app=$APP_ID_ANDROID
AppfileName=$APP_NAME_ANDROID
AppCustomID=Corkscrew_andorid
autoAcceptAlerts=true
autoGrantPermissions=true
browserstack.debug=true
device=Samsung Galaxy Note 9
deviceName=Android Emulator
deviceOrientation=portrait
name=cs_test
os=android
os_version=8.1
no-reset=true
full-reset=false
autoWebview=true
response from Webdriver has old version of chromedriver.
'status': 100, 'value': {'message': 'chrome not reachable\n ...o: chromedriver=2.42.591071
appium logs: HERE
probably (I guess) the driver is not active anymore and new one was created by launching app. But how can I get the new driver?

Huawei, logcat not showing the log for my app?

OK, logcat is showing system logs but it is not showing application log on my Huawei Ascend. If I switch to another device such as my Galaxy Nexus or Nexus 7 then for the same app (same APK even) log is displayed.
The Huawei Ascend is running Android 4.1.1, it has USB debugging switched on in developer options. This occurs for logcat run from either the command line or from IntelliJ. And I'm making sure that the correct device is selected - in fact I'm only plugging a single device in at a time. I've tried restarting adb, clearing it's buffer etc
I can see that the app is starting on the Huawei, I even get system logs showing that the Activity has started. But unlike on the other devices I get no app log in the Activity#onCreate (or from anywhere else).
08-08 20:55:44.050: INFO/WindowManager(431): Switching to real app window: Window{41ae8780 au.com.xandar.wirelesstiming.timekeeper/au.com.xandar.wirelesstiming.timekeeper.TimeKeeperActivity paused=false}
08-08 20:55:44.180: INFO/ActivityManager(431): Displayed au.com.xandar.wirelesstiming.timekeeper/.TimeKeeperActivity: +387ms
How can the application log not be getting delivered?
OK, since I had another Huawei Ascend I ran into the same problem. This time I have the exact answer. Follow these instructions (from denispyr's answer on Why doesn't logcat show anything in my Android?)
Dial
*#*#2846579#*#*
and you will see a hidden menu. Go to the Project Menu > Background Setting > Log setting and define the log availability (log switch) and level (log level setting).
And then make sure you restart your phone.
Please note this probably only applies to Huawei phones.
Also note that if you're on a Huawei tablet (e.g. MediaPad M3), instead of dialing, you launch the Huawei Calculator in landscape and enter ()()2846579()().
For Huawei with Android 8.0+
we must dial the code: *#*#2846579#*#*
and selecting the option AP Log will be enough to display the messages in the LogCat.
If any one having Letv Phone (LeEco Le Max 2 or 1) above solution won't work. Try the below USSD. Fig.1 for reference.
Press Dialer *#*#76937#*#*
Select "Enable All Logs"
Instead of using
Log.d(TAG, msg);
Try this.
Log.wtf(TAG, msg);
work for me.
I have a HUAWEI Y3 II aka LUA-L21.
The accepted answer didn't work for me.
It led to some MTKLogger settings screen, which is different than described in the answer, and didn't help at all.
My solution
Dial *#*#2846580#*#* (please note this code is different from the one in the accepted answer)
You just entered a settings screen called EngineerMode (again, different from accepted answer's ProjectMenu)
In the first Telephony tab, click the Log Control item
Activate both switches (set Mtklog control to catch all log and adb radio log to catch radio log by adb)
Back in the previous screen, swipe to the Log and Debugging tab
Open Debug Utils
Change Debug Level from User Mode to Engineer Mode
For good measure, restart your phone
Screens
Changing Log control
Changing Debug utils
Additional notes
Just to clarify my original problem; logcat was showing some of my app's log entries, just not my own messages - I saw entries belonging to my process com.example.myapp, but never anything I was printing out myself, in my code, using Log.d("TAG", "hello world");
There was plenty of stuff like this:
4260-4270/com.example.myapp I/art: Debugger is no longer active
4260-4412/com.example.myapp I/System.out: [CDS]rx timeout:1
4260-4412/com.example.myapp D/NativeCrypto: doing handshake ++
4260-4603/com.example.myapp D/OpenGLRenderer: Flushing caches (mode 0)
4260-4603/com.example.myapp D/Surface: Surface::disconnect(this=0xb85285d8,api=1)
4260-4260/com.example.myapp D/ActivityThread: ACT-STOP_ACTIVITY_HIDE handled : 0 / android.os.BinderProxy#2333cbdf
...but never anything like this:
4260-4603/com.example.myapp D/MainActivity: hello from onCreate!
The above steps solved the issue for me.
Some newer versions of Huawei Phones (I am using a Y9s 2019) have some settings changed.
Process is now
Dial *#*#2846579#*#*
Background Settings -> AP LOG Settings -> Open.
If you still can't see the logs, restart both your phone and Android Studio/Eclipse
Open your Dialer app and enter the following code: *#*#2846579#*#*.
1-Enter the Background Settings page.
2-Click on “Log Settings”
3-Check all 3 options to enable full logging.
4-Ignore the "will affect performance" warning.
5-Reboot the phone.
Try downloading a Logcat app(eg aLogCat) on your device itself and see if you are having the same problem.
I know its not a complete solution, but this way you may be able to figure out whats going wrong by reading the application logs.
Try this:
In Eclipse editor:
Reset adb from windows-->devices and then try again ...
please check your project is highlighted with green color (simply select your projrct name)

What to do when app crashes and logcat shows no errors

The app works fine in the emulator, but after installation on a phone, it crashes every time on launch, and logcat shows no errors.
What am I supposed to do when something like this happens?
My Suggestion for easier resolution of your problem :
Run the app from the eclipse in debug mode on the Phone . It will make it run on debug mode. You will most likely get more debug output.
Turn on ADB in the phone.
Connect the Phone to the PC
Run as "Debug Configuration" from eclipse.
It should run from your phone and Eclipse will ask for your choice for first time before running that.
Turning the Debug Mode on ( Note : This isn't the 'ADB connection' we are referring to ) , It will enable further logging of the application and doesn't do garbage collection normally.
( You will notice a 'Waiting for debug connection' dialogue , if the applications are forced to work in debug mode ).
For e.g :It makes the Async threads keep running and doesn't stop running. Crude and irrelevant for your case . But just as an example.
So , Since the Applications in the phone are forced to run in debug mode , it will get the logcat with detailed errors down to the specific threads.
However, the debug mode is better used when it's used in conjunction with "Debug As" run configuration from Eclipse. And keep in mind that it will automatically turn on that debug application mode ( And there by the dialog box also) , the logcat will show you more details and plus it will break-point at the errors which occur ,in their sequence of occurence.
Regarding what Ares told,
When you want to do the debugging of a process directly,
You can go to the DDMS panel in Eclipse,
On the right side tab menu Devices ,
Select the process you want to debug . and click on the green symbol ( Says, Start Debugging process )
It will automatically go to the source when it breaks if you have the source code in that eclipse work-space.
Additional hint:
On huawei phones, logcat doesn't show debug messages and excpetions, if the phone is in default system settings.
In order to enable logcat full logs on Huawei phones, you must do the following:
Open the factory settings menu by dialing *#*#2846579#*#*
Navigate to Project Menu / Background Setting / Log setting
On older phones: define the log availability (log switch) and level (log level setting).
On never phones: tick AP Log (which seems to enable app logging in general) and CP Log (seems to enable debug logging)
Close the menu with your backbutton (no restart needed)
Source: https://stackoverflow.com/a/18395092/1075072
Install a tool like AndroidSystemInfo that can show you the logfile on the phone - even when you are away from the host computer.
It is pretty unusual that Android leaves no trace whatsoever.
Does your app perhaps require features that the phone does not have (e.g. a camera or gps or nfc)?
In Eclipse you should go to DDMS, then click on device's name or android.os in Devices panel. And turn your device in debug mode.
Put your own logs to track what block of code cause crashe, or just debug it.
You can reset adb (In Devices -> View menu -> Reset adb)
Click on the selected online device/emulator to show the logcat
Disconnect the cable and again connect it. (Or restart the emulator)
Restart Eclipse
I restarted my emulator and cleaned my build. This got rid of both the non-logging and the spurious crash I was having

Android: Emulator frequently disconnected (offline)!

Sometime just after I launched a new emulator, for very first time I was trying to upload my apk, however I got "emulator: ERROR: the user data image is used by another emulator. aborting".
I launched a new emulator, and left it alone, several minutes later, DDMS showed "device offline".
I had to restart a new one, you know, minutes wasted.
It's really bothering that I keep getting this error and slowed down debugging.
How do I fix it?
If the emulator is still alive, you can tell adb to connect to it via tcp (which is I believe what it does anyway, only it normally uses an 'emulator' class of name and would now get a ip:port one)
It's been a while since I've had to do that, but I think that if you were using emulator-5554 you would connect to your development machine's loopback one port higher, ie:
adb connect localhost:5555
If it works adb devices will show it an eclipse should see it as a deployment option
The 'in use' problem sounds like a stale lockfile perhaps left behind in a crash
I have another solution. try this
Run configurations > Target > Wipe user data > Run
In my case it happens when I have another process listening on emulator port.
e.g. if I see:
emulator-5554 offline
it means that something is using port 5554
Manually delete these following folders:
C:\Users\%UserName%.android\avd\AVD2.1.avd\cache.img.lock
C:\Users\%UserName%.android\avd\AVD2.1.avd\userdata-qemu.img.lock
this always works for me. :3
On Arch Linux x64, I had this similar problem which led me to this question. Using Eclipse, the emulator-5554 window would freeze, and Eclipse prompted me to start a new one. In the following dialog, emulator-5554 was reported to be offline, with an unknown target. If I started a new instance, it would be emulator-5556. This problem persisted through Eclipse restarts and log-off-on cycles too! Further, killx would close the window, but the process was still running.
So, find the emulator64-arm process id (not emulator-arm!):
ps ax | grep "emulator64-arm"
...and then just kill -9 it:
sudo kill -9 6728
...where 6728 was its PID. This completely disconnects the emulator so Eclipse can try to run it again.
Open android debug monitor window by
typing "monitor" command in cmd,
then select device in the monitor window,
click on down arrow as shown in the figure then just click on reset tab thats all you will get internet connection.
It was some strange
I had that problem, automatically stopped the emulator localhost:5554 after to launch the application.
I didn't know why it happens but intil today I did something different at I could launch as normality.
What I did as different was to change the prespective of Eclipse ADT. I was executing the application from Debug and now I executed from Java Prespective, it worked, I don't know the reason, I had to share it, sound some .. this answer but I resolved doing that without deleting and creating again my android virtual device.

Categories

Resources