Status Update
Comments
hu...@google.com <hu...@google.com>
az...@lyft.com <az...@lyft.com> #2
Is this specific to navigation? Or can this be reproduced with another other Composable component?
az...@lyft.com <az...@lyft.com> #3
It only happens inside of a NavHost. So, yes, it seems to be specific to navigation.
[Deleted User] <[Deleted User]> #4
This was caused by the fix to BackHandler
lifecycle aware. The problem here is that the NavController
registers its lifecycle and added an observer to the Activity
Lifecycle
in composition while the BackHandler
registers its observer on the Activity
Lifecycle
in a DisposbleEffect
. This means that the NavController
will always get Lifecycle callbacks before the BackHandler
, so the components listening the the NavController
's lifecycle (like the NavBackStackEntry) will always get their Lifecycle callbacks before the BackHandler
as well.
This should be addressed by work coming in 2.7 to integrate the BackHandler
into the NavHost
.
lf...@google.com <lf...@google.com>
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit d2c5efe67531a30fb9f1a129d52beb1e9ece0b29
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed May 31 23:09:54 2023
Integrate BackHandler into NavHost
Instead of NavHost taking over the onBackPressedDispatcher from the
Activity, we should just make it use a BackHandler. This will ensure
that it interacters with the other BackHandlers in Compose correctly.
RelNote: "`NavHost` now correctly intercepts system back calls even
after the Activity has been `STOPPED` and `RESUMED`."
Test: modified tests
Bug: 279118447
Change-Id: Icb6deab996d122487243f0d3d775af8c15fc7c25
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
lf...@google.com <lf...@google.com> #6
This has been fixed internally and will be available in Navigation 2.7.0-beta01.
ap...@google.com <ap...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-compose:2.7.0-beta01
lf...@google.com <lf...@google.com> #8
ri...@gmail.com <ri...@gmail.com> #9
I wouldn't say this is fixed. If you add a back-callback in the activity which is lifecycle aware, and then background->foreground the app, the activity back-callback will be put on top of the callback pile. This leads to that any BackHandler in your composable will NOT be triggered.
The best workaround I have for now is to use the non-lifecycle aware function in the activity.
class MainActivity : FragmentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// open fragment which hoists the composables
...
if (savedInstanceState == null) {
onBackPressedDispatcher.addCallback(onBackPressedCallback = someBackHandling())
// onBackPressedDispatcher.addCallback(owner = this, onBackPressedCallback = someBackHandling) // not this one
}
}
az...@lyft.com <az...@lyft.com> #10
lf...@google.com <lf...@google.com> #11
az...@lyft.com <az...@lyft.com> #12
Bug Fixes : NavHost in Navigation Compose now correctly intercepts system back calls even after the Activity has been STOPPED and RESUMED.
It works fine for me.
lf...@google.com <lf...@google.com> #13
lf...@google.com <lf...@google.com>
ha...@gmail.com <ha...@gmail.com> #14
In my case it works fine when the app is first ran, but my custom callback calls navController.popBackStack internally if it can't handle back press on its own. So, when I run the app and click back, everything works, but after I pop up all the Composables from the stack and return to the app, the custom callback is not called anymore.
ab...@gmail.com <ab...@gmail.com> #15
Re
Note that you should never, ever be calling navController.popBackStack()
in your own BackHandler
as Navigation must be the only one handling its own back stack with the system back button so that Predictive Back works correctly in the future.
ab...@gmail.com <ab...@gmail.com> #16
[Deleted User] <[Deleted User]> #17
I believe this is still an issue even without using NavHost like mentioned in
ta...@gmail.com <ta...@gmail.com> #18
be...@gmail.com <be...@gmail.com> #19
ja...@gmail.com <ja...@gmail.com> #20
lf...@google.com <lf...@google.com> #21
pe...@gmail.com <pe...@gmail.com> #22
[Deleted User] <[Deleted User]> #23
v....@gmail.com <v....@gmail.com> #24
The problem still exists.
Tech info: Android Studio 4.1.3 Build #AI-201.8743.12.41.7199119, built on March 11, 2021 Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.15.7
Android Emulator version 30.5.3
es...@gmail.com <es...@gmail.com> #25
Android Studio 4.1.3
Build #AI-201.8743.12.41.7199119, built on March 11, 2021
Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.6
GC: ParNew, ConcurrentMarkSweep
Memory: 1237M
Cores: 8
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true
ez...@squareup.com <ez...@squareup.com> #26
Android Studio 4.1.2
Build #AI-201.8743.12.41.7042882, built on December 19, 2020
Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.16
GC: ParNew, ConcurrentMarkSweep
Memory: 20131M
Cores: 16
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true
Non-Bundled Plugins: idea.plugin.protoeditor, org.intellij.plugins.markdown, org.jetbrains.kotlin, com.squareup.idea.toolkit
ja...@gmail.com <ja...@gmail.com> #27
bu...@gmail.com <bu...@gmail.com> #28
ma...@allegro.com <ma...@allegro.com> #29
ta...@gmail.com <ta...@gmail.com> #30
ad...@gmail.com <ad...@gmail.com> #31
cr...@gmail.com <cr...@gmail.com> #32
ma...@gmail.com <ma...@gmail.com> #33
v....@gmail.com <v....@gmail.com> #34
Can confirm a workaround for this situation when bluetooth devices used - disconnect and connect headphones again when the emulator is already running. For some reasons after reconnecting the sound is fine. Based on that I believe it is something that happens only when AVD is starting.
P.S. Please stop sending +1
, since it is not helpful and spams every other person following this issue. Just star the issue at the top of the page.
ar...@gmail.com <ar...@gmail.com> #35
pe...@gmail.com <pe...@gmail.com> #36
ko...@gmail.com <ko...@gmail.com> #37
su...@gmail.com <su...@gmail.com> #38
wi...@rangle.io <wi...@rangle.io> #39
sh...@arosii.dk <sh...@arosii.dk> #40
sh...@arosii.dk <sh...@arosii.dk> #41
cp...@gmail.com <cp...@gmail.com> #42
This is not fixed! And noise created by emulator now is even harder to get rid sometimes even disconnect/reconnect of earphones doesn't help :(
mo...@gmail.com <mo...@gmail.com> #43
ti...@gmail.com <ti...@gmail.com> #44
dj...@gmail.com <dj...@gmail.com> #45
st...@gmail.com <st...@gmail.com> #46
Android Studio Arctic Fox | 2020.3.1 Patch 1
Build #AI-203.7717.56.2031.7621141, built on August 8, 2021
Runtime version: 11.0.10+0-b96-7281165 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.5.2
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 12
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin
ad...@linkedin.com <ad...@linkedin.com> #47
Build: AI-203.7717.56.2031.7621141, 202108071636,
AI-203.7717.56.2031.7621141, JRE 11.0.10+0-b96-7281165x64 JetBrains s.r.o., OS Mac OS X(x86_64) v11.5.2
AS: Arctic Fox | 2020.3.1 Patch 1; Kotlin plugin: 203-1.5.30-release-411-AS7717.8; Android Gradle Plugin: 7.0.0; Gradle: (gradle version information not found); Gradle JDK: version 11.0.10; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: LLDB 3.1 (revision: 3.1.4508709); CMake: from local.properties: (not specified), latest from SDK: 3.18.1-g262b90
ca...@discordapp.com <ca...@discordapp.com> #48
mi...@gmail.com <mi...@gmail.com> #49
Still exists in Android Emulator 30.8.4
Android Studio Arctic Fox | 2020.3.1 Patch 2
Build #AI-203.7717.56.2031.7678000, built on August 27, 2021
Runtime version: 11.0.10+0-b96-7249189 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.4
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: Key Promoter X, cn.neday.excavator, com.bloc.intellij_generator_plugin, com.herbert.george.flutter-snippets, de.netnexus.camelcaseplugin, me.laria.code.idea_caseconv, Dart, wu.seal.tool.jsontokotlin, org.jetbrains.kotlin, io.flutter, com.jetbrains.kmm, com.suusan2go.kotlin-fill-class, izhangzhihao.rainbow.brackets
be...@microsoft.com <be...@microsoft.com> #50
This is still occurring, but given this issue is marked as fixed I'd recommend starring/commenting on an open one e.g.
ga...@gmail.com <ga...@gmail.com> #51
This problem just got worse. I have been able to work around this by setting hw.audioInput=no
in my emulator config.ini. However, this recently stopped working.
This is enormously disruptive:
- If I open or restart an emulator while on a Zoom call, I'm stuck with terrible audio for the remainder of the meeting.
- Changing the mic back to the internal mic from my WH-1000XM3 doesn't change BT back to a2dp. I have to toggle Bluetooth
- I can't toggle Bluetooth because I'm using a Bluetooth keyboard and mouse so if I turn it off, I have to go to my laptop, open the lid, and turn it back on.
M1 Pro MacBook + Emulator 31.2.8
er...@gmail.com <er...@gmail.com> #52
Hey, I've been using -noaudio
flag when launching an emulator and it's working fine.
Here's my example alias command:
alias androidsim="cd ~/Library/Android/sdk/emulator && ./emulator -avd Nexus_5X_API_28 -noaudio"
bo...@google.com <bo...@google.com> #53
we will address this problem
na...@gmail.com <na...@gmail.com> #54
At least give us the option to disable audio for the emulator within android studio.
al...@gmail.com <al...@gmail.com> #55
jm...@qq.com <jm...@qq.com> #56
Ranjit, could you please confirm this fix is available in 31.3.9?
You need bluetooth headphones for it.
1. Connect the headphones to the host.
1. Start some audio on the **host** (e.g. a youtube video with good audio quality).
1. Coldboot an emulator (you can use any system image, e.g. S), notice host's audio quality drops when the emulator starts.
1. Add `hw.audioInput=no` to the AVD's `config.ini`.
1. Coldboot the emulator again, check if host's audio quality is unaffected.
This is a valid solution!!!
sh...@gmail.com <sh...@gmail.com> #57
It did not work on my Mac
he...@gmail.com <he...@gmail.com> #58
as...@gmail.com <as...@gmail.com> #59
pa...@outlook.com <pa...@outlook.com> #60
It's appalling that this is still a problem 8 years later. During a meeting trying to show case a feature using the Android 10 emulator and suddenly my audio gets killed, my microphone muted, and all I can hear is sounds from the emulator. No one in the meeting can hear me too. Checking the emulator settings shows the mic input is already off, but makes no difference. Solution was the same as #56 . It's deplorable that this is a well known bug and they still pretend to be fixed.
rk...@google.com <rk...@google.com> #61
Hi particlecore, please try an API33 or API34 AVD. This is the
mt...@gmail.com <mt...@gmail.com> #62
Finger crossed 🤞 (but I already lost hope in Google and fixing bugs :D)
Description
Emulator Version (Emulator--> Extended Controls--> Emulator Version): any AVD
Android SDK Tools: 25.1.3
Host Operating System: Windows 1é x64
Steps to Reproduce Bug:
1. Start music (MP3) in Music Groove
2. Listen music
3. Start AVD
4. Music sound is changed!
5. Stop AVD
6. Music is back in normal
Expected Behavior: Not changed music
Observed Behavior: Music sounds is chnaged
Play recording sound it's recorded by my phone.
Between 5-6s sound is changed (it start AVD)