Status Update
Comments
sc...@google.com <sc...@google.com> #2
1. Have you saw crash in real device or only in simulators?
2. Do you use dynamic feature for language ID?
sc...@google.com <sc...@google.com> #3
Tested on Android 12 Emulator with custom executor, but cannot repro this issue.
sc...@gmail.com <sc...@gmail.com> #4
-
Second crash in the description is from a real device. Experienced it myself on two different Xiaomi phones, plus lots of crashes from users in the Google Play console.
-
Dynamic features are not used in the application.
As a wild guess, I have downgraded build tools from 31.0.0 to 30.0.3, compileSdk from 31 to 30, and moved all work with Language ID to the service in a separate process (just to be sure that crash can kill secondary process instead of main). This combination is in beta for 2 days by now and I don't see any SIGSEGV crashes.
sc...@gmail.com <sc...@gmail.com> #5
Hmm, I feel the crash might be something related to separate/secondary process.
I also changed compileSdk and targetSDK to 31 but still cannot repro this issue.
ap...@google.com <ap...@google.com> #6
On the contrary, there was no separate process before, when crashes started.
In the new build (with the aforementioned changes) I can see SIGSEGV crash, but only one instead of dozens and it has a bit different backtrace:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
liblanguage_id_jni.so (offset 0x11e000)
backtrace:
#00 pc 000000000003c7c0 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003b960 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003bb48 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003bafc /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000036c98 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000032714 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000031cac /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000057438 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/oat/arm64/base.odex (offset 0x57000)
sc...@google.com <sc...@google.com> #7
FYI, ML Kit launched a new language ID SDK in the latest release, which uses a new language ID model.
Could you try the new SDK version(17.0.0) to check if you can still repro this native crash? Thanks!
Description
// If at all possible, capture an Android logcat (
CAMERAX VERSION (ex - 1.0.0-alpha07)
androidx.camera:camera-camera2:1.0.0-beta05
androidx.camera:camera-lifecycle:1.0.0-beta05
androidx.camera:camera-view:1.0.0-alpha12
CAMERA APPLICATION NAME AND VERSION: (Settings > Apps > (app name) > version)
1.0
ANDROID OS BUILD NUMBER: (Settings > About > Build number)
R16NW.G930VVRU8CRJ3
DEVICE NAME: (Nexus 5X, Samsung S6, etc)
Samsung Galaxy S7 (SM-G930V)
DESCRIPTION:
Tap to focus (via startFocusAndMetering()) only works a few times. Anywhere between 2 and 4 times before it stops actually focusing the requested point. Instead of focusing on the requested point it clearly makes an attempt and then reverts back to the original focus point. Equivalent behavior to attempting to focus on an object too close.
See screenshot to see the screen I'm testing with. Phone is on a stand, focusing another smaller stand.
LIST ANY EXPERIMENTAL FEATURES: (As an example - @ExperimentalCamera2Interop)
Unaware of any.
STEPS TO REPRODUCE:
1. Add tap to focus
2. Run app
3. Tap on an object far away
4. Tap on an object nearby
5. Repeat step 3-4 until it stops working (usually stops working after 2 changes to focus)
OBSERVED RESULTS:
The lens blurs for a second or so as it attempts to focus the requested point, then reverts back to original focus point.
EXPECTED RESULTS:
The lens blurs for a second and then focuses on the requested point
REPRODUCIBILITY: (5 of 5, 1 of 100, etc)
5 of 5 (100%)
ADDITIONAL INFORMATION:
I have attempted to add a call to cancelFocusAndMetering() (and using the future to await the completion) prior to calling startFocusAndMetering() to no avail.
The code I used is adapted from the official recommended way of doing tap to focus, including trying to add disableAutoCancel() since I saw it mentioned in one of the issues reported by another user in here. I tried the following:
1. Calling cancelFocusAndMetering prior
2. Adding .disableAutoCancel() to the action builder
3. Checking that the coordinates are accurate (they are)
4. Searching for similar issues
5. Searching the github sample code for any examples of tap to focus (there are none)
5. Disabling the scaleDetector code but ensuring we only focus once (on ACTION_UP)
Sometimes it seems to recover after a while. I'm not entirely sure what triggers it but it may be related to autofocus.
CODE FRAGMENTS (this will help us troubleshoot your issues):
```
viewFinder.setOnTouchListener { v, event ->
if (event.action != MotionEvent.ACTION_UP) {
return@setOnTouchListener scaleDetector.onTouchEvent(event)
}
val camera = camera ?: return@setOnTouchListener true
// Create a factory for creating a MeteringPoint
val factory = viewFinder.createMeteringPointFactory(cameraSelector)
// Convert UI coordinates into camera sensor coordinates
val point = factory.createPoint(event.x, event.y)
// Prepare focus action to be triggered
val action = FocusMeteringAction.Builder(point)
.disableAutoCancel()
.build()
// Execute focus action
camera.cameraControl.startFocusAndMetering(action).addListener(Runnable {
Log.d(TAG, "Focused at ${point.x} x ${point.y}.")
}, cameraExecutor)
v.performClick();
}
```