Open krll-kov opened 1 month ago
Suggested fix (add try case wrapper), i tested and it helped:
PermissionHandlerWindowsPlugin::PermissionHandlerWindowsPlugin(){
try {
m_positionChangedRevoker = geolocator.PositionChanged(winrt::auto_revoke,
[this](Geolocator const& geolocator, PositionChangedEventArgs e)
{
});
} catch (...) {
/* Do nothing */
}
}
void PermissionHandlerWindowsPluginRegisterWithRegistrar(
FlutterDesktopPluginRegistrarRef registrar) {
try {
PermissionHandlerWindowsPlugin::RegisterWithRegistrar(
PluginRegistrarManager::GetInstance()
->GetRegistrar<PluginRegistrarWindows>(registrar));
} catch (...) {
/* Do nothing */
}
}
Old windows 10 machines encounter crashing issues related to plugin implementation (even when plugin is not used on this platform).
I have a cross-platform app with Android and Windows support, i added flutter-permission-handler plugin to my android app and do not even use it's code on windows, hover, upon app's launch it crashes with this error (can be only seen with Visual Studio, if app is launched without visualstudio, it just instantly closes when it's launched):
winrt::hresult_class_not_registered, [[noreturn]] inline WINRT_IMPL_NOINLINE void throw_hresult(hresult const result)