Caused by: java.lang.IllegalArgumentException: WebView cannot be used with device protected storage

前两天我们的应用要集成到手机里作为系统应用添加了如下属性


        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"
哈哈?

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章