In the project that I am currently working on uses a webview for Login (OAuth). Please find the below stackTace where the activity has not been inflated and has been crashed. The below is the exact exception seen in the firebase crashlytics.
Fatal Exception: java.lang.RuntimeException Unable to start activity
ComponentInfo{{package}/{classname}}: android.view.InflateException:
Binary XML file line #14 in {package}:layout/{activity_xml_file}:
Binary XML file line #14 in {package}:layout/{activity_xml_file}:
Error inflating class android.webkit.WebView
Caused by android.view.InflateException Binary XML file line #14 in
{package}:layout/{activity_xml_file}: Binary XML file line #14 in
{package}:layout/{activity_xml_file}: Error inflating class
android.webkit.WebView
Caused by android.view.InflateException Binary XML file line #14 in
{package}:layout/{activity_xml_file}: Error inflating class
android.webkit.WebView
Caused by java.lang.reflect.InvocationTargetException
java.lang.reflect.Constructor.newInstance0
Caused by
android.webkit.WebViewFactory$MissingWebViewPackageException Failed
to load WebView provider: No WebView installed
The crash has occurred on setContentView of the activity, when on setting the view to the respective activity.
On looking into other solutions from StackOverFlow, some suggested to use try and catch block on loading the view to the activity setContentView().
Is there any possible way to handle this other than try and catch.
Referred Links :
android Failed to load WebView provider: No WebView installed