前两天我们的应用要集成到手机里作为系统应用添加了如下属性
android:directBootAware="true"
android:defaultToDeviceProtectedStorage="true"
然后打开webview就报错如下;
java.lang.RuntimeException: Unable to start activity ComponentInfo{-------}: android.view.InflateException: Binary XML file line #14: Binary XML file line #14: Error inflating class android.webkit.WebView
---
Caused by: android.view.InflateException: Binary XML file line #14: Binary XML file line #14: Error inflating class android.webkit.WebView
09-25 15:12:44.364 25765 25765 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class android.webkit.WebView
09-25 15:12:44.364 25765 25765 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
09-25 15:12:44.364 25765 25765 E AndroidRuntime:
Caused by: java.lang.IllegalArgumentException: WebView cannot be used with device protected storage
原因:webview不能与设备保护存储一起使用
解决方案:
去掉:android:directBootAware="true" android:defaultToDeviceProtectedStorage="true"
哈哈?