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

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