Fixed
Status Update
Comments
rm...@google.com <rm...@google.com> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Android build
Which Android build are you using? (e.g. OPP1.170223.012)
Steps to reproduce
What steps are needed to reproduce this issue?
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Screen record of the issue, for clarity
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
NOTE : To avoid leaking private information, please share screenshots and bugreports only in Google Drive. Share files with android-bugreport@google.com and include only Google drive links in your bug. Bug report attachments should not be included directly in issue reports.
Android build
Which Android build are you using? (e.g. OPP1.170223.012)
Steps to reproduce
What steps are needed to reproduce this issue?
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Screen record of the issue, for clarity
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
NOTE : To avoid leaking private information, please share screenshots and bugreports only in Google Drive. Share files with android-bugreport@google.com and include only Google drive links in your bug. Bug report attachments should not be included directly in issue reports.
ku...@gmail.com <ku...@gmail.com> #3
Android 9 on Nokia 7 Plus
Build number 00WW_3_54H_SP03
Android Studio 3.5.1 on macOS 10.13.6
compileSdkVersion 29
buildToolsVersion '29.0.2'
minSdkVersion 17
targetSdkVersion 28
implementation 'androidx.biometric:biometric:1.0.0-rc01'
Code taken from "Allow for fallback to non-biometric credentials" in
https://developer.android.com/training/sign-in/biometric-auth
Problem:
1. Show biometric prompt.
2. Tap "USE PASSWORD" instead of scanning fingerprint.
3. Unlock using pattern.
4. Activity stops responding.
See attached MP4 video.
This happens consistently.
Project attached in MyApplication.zip
Build number 00WW_3_54H_SP03
Android Studio 3.5.1 on macOS 10.13.6
compileSdkVersion 29
buildToolsVersion '29.0.2'
minSdkVersion 17
targetSdkVersion 28
implementation 'androidx.biometric:biometric:1.0.0-rc01'
Code taken from "Allow for fallback to non-biometric credentials" in
Problem:
1. Show biometric prompt.
2. Tap "USE PASSWORD" instead of scanning fingerprint.
3. Unlock using pattern.
4. Activity stops responding.
See attached MP4 video.
This happens consistently.
Project attached in MyApplication.zip
rm...@google.com <rm...@google.com>
ch...@google.com <ch...@google.com>
zh...@gmail.com <zh...@gmail.com> #4
Same issue with androidx.biometric:biometric:1.0.0-rc02
Android 9 on Nokia 7 Plus
Build number 00WW_3_54H_SP03
Android Studio 3.5.1 on macOS 10.13.6
compileSdkVersion 29
buildToolsVersion '29.0.2'
minSdkVersion 17
targetSdkVersion 28
implementation 'androidx.biometric:biometric:1.0.0-rc02'
Code taken from "Allow for fallback to non-biometric credentials" in
https://developer.android.com/training/sign-in/biometric-auth
Problem:
1. Show biometric prompt.
2. Tap "USE PASSWORD" instead of scanning fingerprint.
3. Unlock using pattern.
4. Activity stops responding.
See attached MP4 video.
This happens consistently.
Android 9 on Nokia 7 Plus
Build number 00WW_3_54H_SP03
Android Studio 3.5.1 on macOS 10.13.6
compileSdkVersion 29
buildToolsVersion '29.0.2'
minSdkVersion 17
targetSdkVersion 28
implementation 'androidx.biometric:biometric:1.0.0-rc02'
Code taken from "Allow for fallback to non-biometric credentials" in
Problem:
1. Show biometric prompt.
2. Tap "USE PASSWORD" instead of scanning fingerprint.
3. Unlock using pattern.
4. Activity stops responding.
See attached MP4 video.
This happens consistently.
di...@google.com <di...@google.com>
da...@google.com <da...@google.com> #5
I am facing the exact same issue.
Android 9 on Moto Z2 Play (XT1710-07)
Build number PPS29.133-30
Android Studio 3.5.1 on Windows 10 Pro
compileSdkVersion 28
buildToolsVersion '28.0.3'
minSdkVersion 23
targetSdkVersion 28
implementation 'androidx.biometric:biometric:1.0.0-rc02'
Android 9 on Moto Z2 Play (XT1710-07)
Build number PPS29.133-30
Android Studio 3.5.1 on Windows 10 Pro
compileSdkVersion 28
buildToolsVersion '28.0.3'
minSdkVersion 23
targetSdkVersion 28
implementation 'androidx.biometric:biometric:1.0.0-rc02'
yb...@google.com <yb...@google.com> #6
yb...@google.com <yb...@google.com> #8
This error case appears to be triggered by creating BiometricPrompt immediately before calling authenticate(), rather than recreating the prompt in the Activity's onCreate() (or Fragment's onCreateView()) lifecycle method as intended. That's obviously an easy mistake to make, so I'll work on making sure the documentation is clearer here.
The fact that the activity appears to hang afterward is definitely a bug and will be fixed by aosp/1151594, likely in a 1.0.1 bugfix release. For now, I'm closing this bug as a duplicate of b/143683687 .
The fact that the activity appears to hang afterward is definitely a bug and will be fixed by aosp/1151594, likely in a 1.0.1 bugfix release. For now, I'm closing this bug as a duplicate of
pa...@google.com <pa...@google.com> #9
Correction: b/143091227
pa...@google.com <pa...@google.com> #10
Must it be in onCreate?
I'm doing this in onResume instead of onCreate so that the prompt shows up when the user comes back to my app.
I'm doing this in onResume instead of onCreate so that the prompt shows up when the user comes back to my app.
hu...@google.com <hu...@google.com> #11
Project: platform/frameworks/support
Branch: androidx-master-dev
commit df08869e2c6f2d066f1caf143cebdb965c1b5a2c
Author: Curtis Belmonte <curtislb@google.com>
Date: Mon Nov 18 15:17:00 2019
Fix BiometricPrompt + device credential error case
BiometricPrompt currently has a bug in the following usage scenario:
1. The prompt is not instantiated in onCreate() or onCreateView()
2. Device credential auth is enabled with setDeviceCredentialAllowed()
3. authenticate() is called twice in the same activity/fragment
When this happens, the handler bridge is incorrectly reset before the
handler activity can be launched, preventing the prompt from being shown
at all. While this isn't a recommended usage pattern for
BiometricPrompt at the moment, it still shouldn't cause the prompt to
get stuck in this state. This commit therefore ensures that the above
scenario no longer triggers the bug.
Test: Manually, using sample app from b/143097321
Test: ./gradlew biometric:test
Test: ./gradlew biometric:connectedAndroidTest
Fixes: 143097321
Change-Id: Ie7e343d9323437d9765e512a09a0e25a6c86dd8e
M biometric/src/main/java/androidx/biometric/BiometricPrompt.java
M biometric/src/main/java/androidx/biometric/DeviceCredentialHandlerActivity.java
https://android-review.googlesource.com/1168851
Branch: androidx-master-dev
commit df08869e2c6f2d066f1caf143cebdb965c1b5a2c
Author: Curtis Belmonte <curtislb@google.com>
Date: Mon Nov 18 15:17:00 2019
Fix BiometricPrompt + device credential error case
BiometricPrompt currently has a bug in the following usage scenario:
1. The prompt is not instantiated in onCreate() or onCreateView()
2. Device credential auth is enabled with setDeviceCredentialAllowed()
3. authenticate() is called twice in the same activity/fragment
When this happens, the handler bridge is incorrectly reset before the
handler activity can be launched, preventing the prompt from being shown
at all. While this isn't a recommended usage pattern for
BiometricPrompt at the moment, it still shouldn't cause the prompt to
get stuck in this state. This commit therefore ensures that the above
scenario no longer triggers the bug.
Test: Manually, using sample app from
Test: ./gradlew biometric:test
Test: ./gradlew biometric:connectedAndroidTest
Fixes: 143097321
Change-Id: Ie7e343d9323437d9765e512a09a0e25a6c86dd8e
M biometric/src/main/java/androidx/biometric/BiometricPrompt.java
M biometric/src/main/java/androidx/biometric/DeviceCredentialHandlerActivity.java
dr...@gmail.com <dr...@gmail.com> #12
Yes, initializing the prompt in onResume() should be fine as well.
Unmarked as duplicate, since aosp/1168851 should be a more proper fix for this. Targeting it for inclusion in 1.0.1.
Unmarked as duplicate, since aosp/1168851 should be a more proper fix for this. Targeting it for inclusion in 1.0.1.
hu...@google.com <hu...@google.com> #13
hu...@google.com <hu...@google.com> #14
I believe I am facing a related issue. I am using BiometricPrompt with setDeviceCredentialAllowed. This is fully working on an older device running Oreo (now that I recreate the activity each time after using BiometricPrompt). The user can choose to use their fingerprint to authenticate, or can select to use the pin. In both cases, once the user successfully authenticates, onAuthenticationSucceeded is called on the BiometricPrompt.AuthenticationCallback.
However when used in the emulator, running Android 10, as soon as the user selects the "Use PIN" option, onAuthenticationError is called with errorCode=5 and errString=Authentication canceled
However when used in the emulator, running Android 10, as soon as the user selects the "Use PIN" option, onAuthenticationError is called with errorCode=5 and errString=Authentication canceled
ku...@gmail.com <ku...@gmail.com> #15
Yes I am facing the same issue. Once I get the errCode = 5, the activity starting acting very strange. It then again gives an errCode = 10 before crashing again.
je...@google.com <je...@google.com> #16
Hung, can you take another look. thanks !
hu...@google.com <hu...@google.com> #17
So here is the code in ConfigParser.loadDefaultConfig():
fun loadDefaultConfig(): Config? {
val inputStream = javaClass.getResourceAsStream(Config.DEFAULT_CONFIG_RES_PATH)
return parseFromString(inputStream.reader().readText())
}
It seems to me that this method is already thread safe even without the previous fix to add locks in data binding, because the inputStream variable is local and each call to getResourceAsStream() returns a separate stream that can be accessed concurrently.
Of course, this is assuming that the streams were closed properly, but in this case, they are not.
@Filip: Could you fix Jetifier to close the input stream? (I'm not certain that it is the root cause of this bug, but it seems likely.)
fun loadDefaultConfig(): Config? {
val inputStream = javaClass.getResourceAsStream(Config.DEFAULT_CONFIG_RES_PATH)
return parseFromString(inputStream.reader().readText())
}
It seems to me that this method is already thread safe even without the previous fix to add locks in data binding, because the inputStream variable is local and each call to getResourceAsStream() returns a separate stream that can be accessed concurrently.
Of course, this is assuming that the streams were closed properly, but in this case, they are not.
@Filip: Could you fix Jetifier to close the input stream? (I'm not certain that it is the root cause of this bug, but it seems likely.)
ap...@google.com <ap...@google.com> #18
Project: platform/frameworks/support
Branch: androidx-master-dev
commit db43643b011f4ca6a2344c0a58e2b2f5d8f3c324
Author: Filip Pavlis <pavlis@google.com>
Date: Tue Apr 30 16:24:01 2019
Close stream when loading config in jetifier.
Bug: b/120277395
Test: Cannot reproduce the issues.
Change-Id: Ia3bde355bb624597e9a1420d97ff1af69a2509ee
M jetifier/jetifier/core/src/main/kotlin/com/android/tools/build/jetifier/core/config/ConfigParser.kt
M jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/Archive.kt
https://android-review.googlesource.com/954145
https://goto.google.com/android-sha1/db43643b011f4ca6a2344c0a58e2b2f5d8f3c324
Branch: androidx-master-dev
commit db43643b011f4ca6a2344c0a58e2b2f5d8f3c324
Author: Filip Pavlis <pavlis@google.com>
Date: Tue Apr 30 16:24:01 2019
Close stream when loading config in jetifier.
Bug:
Test: Cannot reproduce the issues.
Change-Id: Ia3bde355bb624597e9a1420d97ff1af69a2509ee
M jetifier/jetifier/core/src/main/kotlin/com/android/tools/build/jetifier/core/config/ConfigParser.kt
M jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/Archive.kt
pa...@google.com <pa...@google.com> #19
Assigning back for further integration with AGP.
hu...@google.com <hu...@google.com> #20
Thanks Filip, I'll update the AGP to use the new Jetifier version once it's released.
da...@spotify.com <da...@spotify.com> #21
me...@gmail.com <me...@gmail.com> #22
Is this fix pushed in AGP 3.5 beta ?
hu...@google.com <hu...@google.com> #23
@21: Thanks a lot for the suggestion!
@22: Not yet, because the new Jetifier version with the (speculative) fix is not released yet.
@22: Not yet, because the new Jetifier version with the (speculative) fix is not released yet.
hu...@google.com <hu...@google.com> #24
ja...@gmail.com <ja...@gmail.com> #25
Any updates here? Is there a chance this will make it into AGP 3.5, given that we're on beta 4 now?
hu...@google.com <hu...@google.com> #26
Jetifier 1.0.0-beta05 has been released. To use it, you can add the following to your build.gradle file:
buildscript {
repositories { ...
}
dependencies { ...
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta05'
}
}
Please let us know if you still run into this issue after updating Jetifier. That will confirm whether this issue is actually caused by Jetifier or not.
buildscript {
repositories { ...
}
dependencies { ...
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta05'
}
}
Please let us know if you still run into this issue after updating Jetifier. That will confirm whether this issue is actually caused by Jetifier or not.
hu...@google.com <hu...@google.com> #27
@25: We will integrate Jetifier 1.0.0-beta05 into the coming 3.6 canaries of the AGP, it's too late for 3.5 now.
ku...@gmail.com <ku...@gmail.com> #28
After manually bumping to Jetifier to 1.0.0-beta05 manually in our build, we are still seeing the failure:
Caused by: java.lang.NullPointerException: Inflater has been closed
at kotlin.io.TextStreamsKt.copyTo(ReadWrite.kt:127)
at kotlin.io.TextStreamsKt.copyTo$default(ReadWrite.kt:120)
at kotlin.io.TextStreamsKt.readText(ReadWrite.kt:107)
at com.android.tools.build.jetifier.core.config.ConfigParser.loadDefaultConfig(ConfigParser.kt:54)
at android.databinding.tool.LibTypes$typeRewriter$2.invoke(LibTypes.kt:34)
at android.databinding.tool.LibTypes$typeRewriter$2.invoke(LibTypes.kt:23)
at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81)
at android.databinding.tool.LibTypes.getTypeRewriter(LibTypes.kt)
at android.databinding.tool.LibTypes.convert(LibTypes.kt:182)
at android.databinding.tool.LibTypes$nonNull$2.invoke(LibTypes.kt:120)
at android.databinding.tool.LibTypes$nonNull$2.invoke(LibTypes.kt:23)
at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81)
at android.databinding.tool.LibTypes.getNonNull(LibTypes.kt)
at android.databinding.tool.writer.BaseLayoutBinderWriter.<init>(BaseLayoutBinderWriter.kt:52)
at android.databinding.tool.BaseDataBinder.generateAll(BaseDataBinder.kt:54)
at com.android.build.gradle.internal.tasks.databinding.DataBindingGenBaseClassesTask$CodeGenerator.run(DataBindingGenBaseClassesTask.kt:217)
at com.android.build.gradle.internal.tasks.databinding.DataBindingGenBaseClassesTask.writeBaseClasses(DataBindingGenBaseClassesTask.kt:100)
Caused by: java.lang.NullPointerException: Inflater has been closed
at kotlin.io.TextStreamsKt.copyTo(ReadWrite.kt:127)
at kotlin.io.TextStreamsKt.copyTo$default(ReadWrite.kt:120)
at kotlin.io.TextStreamsKt.readText(ReadWrite.kt:107)
at com.android.tools.build.jetifier.core.config.ConfigParser.loadDefaultConfig(ConfigParser.kt:54)
at android.databinding.tool.LibTypes$typeRewriter$2.invoke(LibTypes.kt:34)
at android.databinding.tool.LibTypes$typeRewriter$2.invoke(LibTypes.kt:23)
at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81)
at android.databinding.tool.LibTypes.getTypeRewriter(LibTypes.kt)
at android.databinding.tool.LibTypes.convert(LibTypes.kt:182)
at android.databinding.tool.LibTypes$nonNull$2.invoke(LibTypes.kt:120)
at android.databinding.tool.LibTypes$nonNull$2.invoke(LibTypes.kt:23)
at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81)
at android.databinding.tool.LibTypes.getNonNull(LibTypes.kt)
at android.databinding.tool.writer.BaseLayoutBinderWriter.<init>(BaseLayoutBinderWriter.kt:52)
at android.databinding.tool.BaseDataBinder.generateAll(BaseDataBinder.kt:54)
at com.android.build.gradle.internal.tasks.databinding.DataBindingGenBaseClassesTask$CodeGenerator.run(DataBindingGenBaseClassesTask.kt:217)
at com.android.build.gradle.internal.tasks.databinding.DataBindingGenBaseClassesTask.writeBaseClasses(DataBindingGenBaseClassesTask.kt:100)
hu...@google.com <hu...@google.com> #29
Thanks for your info.
Finally, I've managed to reproduce this issue and found the root cause. I've explained this in detail at Issue 137929327 .
I'll write a fix for this.
Finally, I've managed to reproduce this issue and found the root cause. I've explained this in detail at
I'll write a fix for this.
hu...@google.com <hu...@google.com> #30
hu...@google.com <hu...@google.com> #31
Jetifer 1.0.0-beta06 containing the fix has been integrated into AGP 3.6.0-alpha10.
Description
Tested on AGP: 3.2.0
error: cannot generate view binders java.io.IOException: Stream closed
at java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:142)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.Reader.read(Reader.java:140)
at kotlin.io.TextStreamsKt.copyTo(ReadWrite.kt:122)
at kotlin.io.TextStreamsKt.copyTo$default(ReadWrite.kt:115)
at kotlin.io.TextStreamsKt.readText(ReadWrite.kt:102)
at com.android.tools.build.jetifier.core.config.ConfigParser.loadDefaultConfig(ConfigParser.kt:54)
at android.databinding.tool.LibTypes$typeRewriter$2.invoke(LibTypes.kt:30)
at android.databinding.tool.LibTypes$typeRewriter$2.invoke(LibTypes.kt:23)
at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:154)
at android.databinding.tool.LibTypes.getTypeRewriter(LibTypes.kt)
at android.databinding.tool.LibTypes.convert(LibTypes.kt:179)
at android.databinding.tool.LibTypes$nonNull$2.invoke(LibTypes.kt:117)
at android.databinding.tool.LibTypes$nonNull$2.invoke(LibTypes.kt:23)
at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:154)
at android.databinding.tool.LibTypes.getNonNull(LibTypes.kt)
at android.databinding.tool.writer.LayoutBinderWriter$write$1.invoke(LayoutBinderWriter.kt:350)
at android.databinding.tool.writer.LayoutBinderWriter$write$1.invoke(LayoutBinderWriter.kt:315)
at android.databinding.tool.writer.KCodeKt.kcode(KCode.kt:172)
at android.databinding.tool.writer.LayoutBinderWriter.write(LayoutBinderWriter.kt:347)
at android.databinding.tool.LayoutBinder.writeViewBinder(LayoutBinder.java:360)
at android.databinding.tool.DataBinder.writeBinders(DataBinder.java:137)