마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

웹뷰에서 a href로 다른 html로 넘어가려는데 강제종료가 돼요

0 추천
문제가 뭔지 몰라서 질문 올립니다.

오류 올릴게요.

09-11 05:12:42.275 4744-4744/com.example.user.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.user.myapplication, PID: 4744
    android.os.FileUriExposedException: file:///android_asset/index.html exposed beyond app through Intent.getData()
        at android.os.StrictMode.onFileUriExposed(StrictMode.java:1958)
        at android.net.Uri.checkFileUriExposed(Uri.java:2348)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9766)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9720)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1609)
        at android.app.Activity.startActivityForResult(Activity.java:4472)
        at android.app.Activity.startActivityForResult(Activity.java:4430)
        at android.app.Activity.startActivity(Activity.java:4791)
        at android.app.Activity.startActivity(Activity.java:4759)
        at android.content.ContextWrapper.startActivity(ContextWrapper.java:366)
        at org.chromium.android_webview.ResourcesContextWrapperFactory$WebViewContextWrapper.startActivity(ResourcesContextWrapperFactory.java:118)
        at org.chromium.android_webview.AwContentsClient.sendBrowsingIntent(AwContentsClient.java:203)
        at org.chromium.android_webview.AwContentsClient.shouldIgnoreNavigation(AwContentsClient.java:170)
        at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:352)
        at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
        at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:41)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
이성은 님이 2018년 9월 11일 질문
컴퓨터로 들어가서 해보면 작동 가능한데
핸드폰으로 실행하면 강제종료가 됩니다.

1개의 답변

0 추천

FileUriExposedException을 구글링 해보시면 이유를 알수 있을거에요

https://developer.android.com/about/versions/nougat/android-7.0-changes?hl=ko​

아마 에뮬레이터는 Nougat 이하의 버전이고 사용하시는 폰은 Nougat 이상이라서 에러가 발생하는 걸거에요

버닝 (4,880 포인트) 님이 2018년 9월 11일 답변
...