Status Update
Comments
wu...@google.com <wu...@google.com> #2
sc...@google.com <sc...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
sh...@gmail.com <sh...@gmail.com> #4
Will stay subscribed to the notifications of this thread for the updates. Thanks a lot for all the help and support!
ch...@google.com <ch...@google.com> #5
Hi,
I can reproduce the preview freeze issue as you described by
Unable to configure camera Camera@22b3c90[id=0]
java.lang.IllegalArgumentException: Not supported Camera2OutputConfigImpl: class androidx.camera.extensions.impl.advanced.Camera2OutputConfigImplBuilder$SurfaceOutputConfigImplImpl
at androidx.camera.extensions.internal.sessionprocessor.m.a(SourceFile:1)
at androidx.camera.extensions.internal.sessionprocessor.a.o(SourceFile:27)
at androidx.camera.extensions.internal.sessionprocessor.a.e(SourceFile:116)
at androidx.camera.extensions.internal.sessionprocessor.w.d(SourceFile:17)
at p.A0.a(SourceFile:446)
at B.b.run(SourceFile:10)
at A.d.a(SourceFile:82)
at A.d.run(SourceFile:590)
at B.n.run(SourceFile:67)
at p2.j.run(SourceFile:3)
at p2.a.run(SourceFile:92)
This is an known issue that we also observed and are clarifying with AGP R8 team.
For the exception callstack you provided, it looks like an expected result when some operations (photo taking or camera control) can't be handled completely but the camera is closed. Then, the corresponding exception will be reported to the app. To prevent from missing any other potential issues different from the known one, could you help to:
- Decode the obfuscate stack trace so that we can know what it really is?
- Check with your user whether he/she also see the Camera2OutputConfigImpl related exception when reproducing the issue?
Thanks.
sh...@gmail.com <sh...@gmail.com> #6
Hi,
Thanks for trying to reproduce the issue on your end and confirming the crash.
Our camera app currently attempts to enable the extension mode over the default camera selector when the extension is available according to the ExtensionManager and when the user is on an extension mode. It's hard to know whether it is the enabling of extension over the default camera selector that causes the crash, or the binding of an extension enabled camera selector, which makes it difficult to debug this further at the moment. However, downgrading the gradle version has helped fix the issue and it seems to be specifically happeing when we use minification in release mode while building.
I have contacted the user to confirm whether the stack trace you have shared is visible to them too to confirm this issue further.
Thanks a lot for your time and help!
Regards,
Mohit
ap...@google.com <ap...@google.com> #7
Branch: androidx-main
commit ff306631e8a500893a5497f741af1c11bb62efdb
Author: CharcoalChen <charcoalchen@google.com>
Date: Wed Jul 24 18:04:50 2024
Workaround Camera2OutputConfigImpl conversion issue after enabling minification
Use try-catch to force cast the input Camera2OutputConfigImpl instance to correct type. Verified the workaround on the real Pixel 7 and S24 Ultra devices which have advanced vendor library implementation.
Relnote: "Resolved a CameraX extensions malfunction on devices like Pixel 7/8 and Samsung Galaxy S24 series. The issue, stemming from a Camera2OutputConfigImpl conversion problem in release mode, surfaced after upgrading AGP to 8.5.1 and enabling minification."
Bug:
Test: manual test on Pixel 7 & S24 Ultra
Change-Id: I9959873ee37f47e07aa617b92859d2a5cadc7830
M camera/camera-extensions/src/main/java/androidx/camera/extensions/internal/sessionprocessor/Camera2OutputConfigConverter.java
sh...@gmail.com <sh...@gmail.com> #8
Hi Charcoal Chen,
Thanks for making a fix for this issue. We'll test this fix and get back soon after this gets included in the one of the upcoming releases of the library.
Thank you for all your time and support!
Regards,
Mohit
ju...@gomore.com <ju...@gomore.com> #9
It seems a bit odd that the fix is a series of try-catches of casts. Couldn't it had been solved by shipping extra ProGuard rules for whatever extra configuration R8 requires now after AGP 8.5.1? Regardless of that it will be appreciated if a fixed release of the CameraX dependency is made available as we needed to do an emergency rollout of a hot fix for our app with night mode disabled.
sg...@google.com <sg...@google.com> #10
This was caused by a bug in R8 (internal issue settings.gradle
or settings.gradle.kts
:
pluginManagement {
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw")
}
}
dependencies {
classpath("com.android.tools:r8:8.5.35")
}
}
}
sc...@google.com <sc...@google.com> #11
Hi developer,
We are sorry to cause you so many troubles. We have been tried to add Proguard rules to fix it but seems not working as the problem is caused by missing file in the app instead of files being obfuscated incorrectly. That's why we end up doing such a weird solution to workaround it.
To avoid the issue from happening in the future, we have added the released flavor apk testing into our daily tests which will monitor any issues that only happen with Proguard/R8. We will fix any issue if found and mitigate any impacts to the developers.
Below are more technical details if you are interested:
The OEM's extensions implementation files are in the device runtime instead of in the app or the libraries. In CameraX, we use "compileOnly" dependency to invoke these runtime library so technically these files are missing in the apps. The R8 bug is that it can't handle the missing file case correctly when apps invoke instanceOf
. So adding the Proguard rules doesn't help.
sc...@google.com <sc...@google.com> #12
One thing to add,
We have always tested the released flavor apk with R8 enabled right before releasing the new CameraX libraries. It is enough for catching CameraX bug but it can't catch the R8/AGP issues quickly. That's why we integrate the released apk testing to our daily testing.
ju...@gomore.com <ju...@gomore.com> #13
Thanks for the testing changes and the clarification!
pr...@google.com <pr...@google.com> #14
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.camera:camera-extensions:1.4.0-rc01
Description
Hi Team CameraX,
Gradle version 8.5.1 seems to currently causing a crash (possibly due to minification) for CameraX extension usage. One of our users reported that switching to night mode caused the preview to freeze and switching to another mode (which rebinds a new camera instance) caused the preview to unfreeze.
Quoting their report on this issue,
(Source:https://github.com/GrapheneOS/Camera/issues/449 )
Downgrading to Gradle 8.5.0 in our app's recent release caused the issue to no longer persist. Could you'll please help us fix this issue?
The CameraX version for which we're facing this issue is CameraX 1.4.0-beta01 and the device on which this issue was reported is Pixel 6.
Please do let us know if any additional information is required for the same
Thanks a lot for your time and all the help and support!
Regards,
Mohit