我正在尝试使用 local_auth 插件在我的 flutter 应用程序中实现指纹认证。但它抛出我平台异常错误:
“平台异常(auth_in_progress,身份验证正在进行,空)”
final LocalAuthentication _localAuth = LocalAuthentication();
bool authenticated = false;
try {
authenticated = await _localAuth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: false
);
} on PlatformException
catch(e) {
print(e);
}
return authenticated; }
Run Code Online (Sandbox Code Playgroud) 通过使用Dart的simple_permissions和location软件包,仅要求用户许可以允许或拒绝该应用使用设备位置在Google Maps上显示用户的当前位置。当我在设备上手动打开GPS时,我可以获取当前位置,但是我该如何要求用户从应用程序本身中启用带对话框的GPS以启用GPS,例如Google Maps?
当我运行应用程序而不添加图像选择器作为依赖项时,它运行良好。但是,当我添加插件并运行时,它给了我gradle构建失败的错误。
Resolving dependencies... 5.0s
Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
D8: Program type already present: android.support.v4.app.INotificationSideChannel
*********************************************************
WARNING: This version of image_picker will break your Android build if it or its dependencies aren't compatible with AndroidX.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
FAILURE: Build failed …Run Code Online (Sandbox Code Playgroud)