Status Update
Comments
ra...@google.com <ra...@google.com>
ra...@google.com <ra...@google.com> #2
The issue turns out to be a problem with how the requestFocus()
was being called. in updateFocusRectInWindowSnapshot
, there is a check for isFocused
that should also consider hasFocus()
. The line should be changed from:
if (!view.isFocused) {
to
if (!view.isFocused && !view.hasFocus()) {
so...@google.com <so...@google.com> #3
Resolved the original issues by using the correct rect value. However the focus shouldn't skip focus even with incorrect value. re-open the issue for investigation purpose. Thank you!
ma...@gmail.com <ma...@gmail.com> #4
Project: platform/frameworks/support
Branch: androidx-main
Author: George Mount <
Link:
Fix requestFocus with bad previous rectangle
Expand for full commit details
Fix requestFocus with bad previous rectangle
Fixes: 388590015
When requestFocus() is called on a ComposeView with a previousRect
set to something that doesn't make sense (empty rectangle from the
wrong direction, for example), the previous behavior would not
find a matching component in that direction. Instead, it would
find the next View to focus on and pass the focus on.
With this CL, if the ComposeView isn't currently focused and a
focusSearch fails to find something focusable in relation to the
previous rectangle, an attempt is made irrespective of the
previous rectangle.
Relnote: "Fixed focus issue where requestFocus() with a
nonsensical previouslyFocusedRect parameter (related to
the focus direction) would skip past a ComposeView."
Test: new test, manual testing
Change-Id: Ifdc2f17b23620d1ae14848624f447f84cc1b0b5d
Files:
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/focus/RequestFocusTest.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
Hash: 8501eec732d61bd71c385a90f58a194191816d57
Date: Fri Jan 10 11:04:59 2025
ma...@gmail.com <ma...@gmail.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui-android:1.8.0-beta01
androidx.compose.ui:ui-jvmstubs:1.8.0-beta01
androidx.compose.ui:ui-linuxx64stubs:1.8.0-beta01
ma...@gmail.com <ma...@gmail.com> #6
same problem? I didn't notice because diffrent category.
so...@google.com <so...@google.com>
so...@google.com <so...@google.com> #7
I was able to reproduce this in a prod environment, but not a debug environment. I believe this may be due to a proguard bug or misconfiguration. Investigation continues...
so...@google.com <so...@google.com> #8
Have confirmed that this was due to depending on an incorrect version of the play-services-base library. play-services-location:21.0.0 depends on play-services-base:18.0.1, when it should instead be depending on play-services-base:18.1.0. We will be deploying a new version of play-services-location (21.0.1) that has this correction. In the meantime, a work-around is simply to explicitly depend on play-services-base:18.1.0 from your project, I have confirmed that this fixes the issue.
ca...@gmail.com <ca...@gmail.com> #9
11-02 09:15:58.327 6934 6934 E AndroidRuntime: java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears in /data/app/~~TmhSIhC5rP4Jp8uE3HMyJw==
Using play-services-base:18.1.0 did not help. Will this also be taken care in upcoming version i.e. 21.0.1 ?
Note: play-services-location:20.0.0 works fine
so...@google.com <so...@google.com> #10
No, that is an intentional change in 21.0.0 (FusedLocationProviderClient is now an interface rather than an abstract class). The major version bump indicates there may be incompatibilities between the v19 release and the v20 release. You will need to recompile your code most likely.
so...@google.com <so...@google.com> #11
play-service-location:21.0.1 is now released and I have confirmed this bug is fixed.
aq...@gmail.com <aq...@gmail.com> #12
Estoy que me rebienta una hacker con su Caos tau la tela araña .riesgo de vida del software
th...@gmail.com <th...@gmail.com> #13
as...@gmail.com <as...@gmail.com> #14
nt...@gmail.com <nt...@gmail.com> #15
so...@google.com <so...@google.com>
go...@gmail.com <go...@gmail.com> #16
go...@gmail.com <go...@gmail.com> #17
// problem
implementation "com.google.android.gms:play-services-location:21.0.1"
// no problem
implementation "com.google.android.gms:play-services-location:20.0.0"
java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears
at com.google.android.libraries.maps.ka.zzcj.zzf(LocationSourceImpl.java:17)
at com.google.android.libraries.maps.ka.zzcj.zza(LocationSourceImpl.java:44)
at com.google.android.libraries.maps.ka.zzba.zzc(GoogleMapImpl.java:716)
at com.google.android.libraries.maps.GoogleMap.setMyLocationEnabled(GoogleMap.java:60)
at com.google.android.libraries.maps.zzak.zza(Unknown Source:2)
at com.google.android.libraries.maps.ka.zzbc.run(Unknown Source:3)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:223)
at android.os.Looper.loop(Looper.java:324)
at android.app.ActivityThread.main(ActivityThread.java:8482)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1061)
so...@google.com <so...@google.com> #18
FusedLocationProviderClient has changed from an abstract class in 20 to an interface in 21. You will need to recompile your code accordingly.
an...@gmail.com <an...@gmail.com> #19
com.google.android.gms:play-services-location:21.0.1
com.google.android.gms:play-services-base:18.01
Device details:
Google Pixel 6a, Android 13, Play Service version 23.23.16 (190400-540660214)
I had to use the suggested workaround:
val locationRequest = LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 1000).build()
val client: SettingsClient = LocationServices.getSettingsClient(context)
val builder: LocationSettingsRequest.Builder = LocationSettingsRequest
.Builder()
.addLocationRequest(locationRequest)
val gpsSettingTask: Task<LocationSettingsResponse> = client.checkLocationSettings(builder.build())
gpsSettingTask.addOnCompleteListener {locationSettingsResponseTask ->
try {
val settingsResponse = locationSettingsResponseTask.getResult(ApiException::class.java)
// request location
} catch (e: ApiException) {
when (e.statusCode) {
LocationSettingsStatusCodes.RESOLUTION_REQUIRED -> {
try {
if (e is ResolvableApiException) {
val resolvableException = e as ResolvableApiException
val intentSenderRequest = IntentSenderRequest
.Builder(resolvableException.resolution)
.build()
// request settings dialog
} else if (e.status.resolution != null) {
val intentSenderRequest = IntentSenderRequest
.Builder(e.status.resolution!!)
.build()
// request settings dialog
}
} catch (ex: Exception) {
}
}
else -> {
}
}
}
}
Description
Device Info
problem code
What was the expected result?
if take
exception.statusCode = LocationSettingsStatusCodes.RESOLUTION_REQUIRED
will be cast
exception as ResolvableApiException
What was the actual result? exception is not ResolvableApiException
Relevant logcat output
Addendum. My product code gives a different error.
Link to captured Android bug report (shared privately in Drive.)
none
Optional: Link to any screenshot(s) that demonstrate the issue (shared privately in Drive)
none