Kitkat kills: Not allowed to load local resource: file:///android_asset/webkit/android-weberror.png

后端 未结 8 1055
半阙折子戏
半阙折子戏 2020-11-30 03:54

I have an app that uses WebViews. I\'ve changed my targetAPI from 18 to 19 and I\'m currently testing on the new 4.4. For some reason I\'m getting this error: Not allo

8条回答
  •  春和景丽
    2020-11-30 04:37

    I found that I had this problem on KitKat when I used webview.loadData(). If I instead used webview.loadDataWithBaseURL() (I used "file:///android_asset/" as the baseURL), then the problem went away.

    The methods setAllowFileAccess(), setAllowFileAccessFromFileURLs(), and setAllowUniversalAccessFromFileURLs() did not have any affect that I could see.

提交回复
热议问题