๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋นˆ ๊ตฌ๋ฉ ์ฑ„์šฐ๊ธฐ

[Android] Using WebView from more than one process at once with the same data directory is not supported. / AwDataDirLock.java / org.chromium.android_webview.AwDataDirLock.b

Crashlytics ๋กœ๊ทธ๋ฅผ ํ™•์ธํ–ˆ๋‹ค.

 

AwDataDirLock.java / org.chromium.android_webview.AwDataDirLock.b

Using WebView from more than one process at once with the same data directory is not supported.

 

Android 9(API level 28) ์ด์ƒ ํƒ€๊ฒŸํŒ…ํ•˜๋Š” ์•ฑ์˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ์— ๋Œ€์‘ํ•˜์ง€ ๋ชปํ•œ ๊ฒƒ์ด์—ˆ๋‹ค.

 

https://developer.android.com/about/versions/pie/android-9.0-changes-28?hl=ko#framework-security-changes

 

๋™์ž‘ ๋ณ€๊ฒฝ์‚ฌํ•ญ: API ๋ ˆ๋ฒจ 28+๋ฅผ ํƒ€๊ฒŸํŒ…ํ•˜๋Š” ์•ฑ  |  Android ๊ฐœ๋ฐœ์ž  |  Android Developers

Android 9(API ๋ ˆ๋ฒจ 28)์—์„œ๋Š” Android ์‹œ์Šคํ…œ์— ๋งŽ์€ ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ๋„์ž…๋ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋™์ž‘ ๋ณ€๊ฒฝ์‚ฌํ•ญ์€ API ๋ ˆ๋ฒจ 28 ์ด์ƒ์„ ํƒ€๊ฒŸํŒ…ํ•˜๋Š” ์•ฑ์—๋งŒ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. targetSdkVersion์ด API ๋ ˆ๋ฒจ 28 ์ด์ƒ์œผ๋กœ ์„ค์ •

developer.android.com

Android 9์—์„œ ์•ฑ ์•ˆ์ •์„ฑ๊ณผ ๋ฐ์ดํ„ฐ ๋ฌด๊ฒฐ์„ฑ์„ ๊ฐœ์„ ํ•˜๊ธฐ ์œ„ํ•ด, ์•ฑ์€ ์—ฌ๋Ÿฌ ํ”„๋กœ์„ธ์Šค ์‚ฌ์ด์—์„œ ๋‹จ์ผ WebView ๋ฐ์ดํ„ฐ ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ๊ณต์œ ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ ์ด๋Ÿฌํ•œ ๋ฐ์ดํ„ฐ ๋””๋ ‰ํ„ฐ๋ฆฌ๋Š” ์ฟ ํ‚ค, HTTP ์บ์‹œ ๊ทธ๋ฆฌ๊ณ  ์›น ๊ฒ€์ƒ‰๊ณผ ๊ด€๋ จ๋œ ๊ธฐํƒ€ ์˜๊ตฌ ์ €์žฅ์†Œ ๋ฐ ์ž„์‹œ ์ €์žฅ์†Œ๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.

๋กœ๊ทธ์™€ ๋™์ผํ•œ ๋‚ด์šฉ์ด ์ ํ˜€ ์žˆ์—ˆ๋‹ค.

 

๋Œ€๋ถ€๋ถ„์˜ ๊ฒฝ์šฐ ์•ฑ์€ WebView ๋ฐ CookieManager์™€ ๊ฐ™์€ android.webkit ํŒจํ‚ค์ง€์˜ ํด๋ž˜์Šค๋ฅผ ํ•œ ํ”„๋กœ์„ธ์Šค์—์„œ๋งŒ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด WebView๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ชจ๋“  Activity ๊ฐ์ฒด๋ฅผ ๋™์ผํ•œ ํ”„๋กœ์„ธ์Šค๋กœ ์ด๋™ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค

ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

์•ฑ์ด ๋‘ ๊ฐœ ์ด์ƒ์˜ ํ”„๋กœ์„ธ์Šค์—์„œ WebView์˜ ์ธ์Šคํ„ด์Šค๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ ๊ฐ ํ”„๋กœ์„ธ์Šค์—์„œ WebView์˜ ์ฃผ์–ด์ง„ ์ธ์Šคํ„ด์Šค๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์ „์— WebView.setDataDirectorySuffix() ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•ด๋‹น ํ”„๋กœ์„ธ์Šค์— ๊ณ ์œ ํ•œ ๋ฐ์ดํ„ฐ ๋””๋ ‰ํ„ฐ๋ฆฌ ์ ‘๋ฏธ์‚ฌ๋ฅผ ์ง€์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ฉ”์„œ๋“œ๋Š” ๊ฐ ํ”„๋กœ์„ธ์Šค์˜ ์›น ๋ฐ์ดํ„ฐ๋ฅผ ์•ฑ์˜ ๋ฐ์ดํ„ฐ ๋””๋ ‰ํ„ฐ๋ฆฌ ๋‚ด์— ์žˆ๋Š” ์ž์ฒด ๋””๋ ‰ํ„ฐ๋ฆฌ์— ๋„ฃ์Šต๋‹ˆ๋‹ค.

 

๋งŽ์€ ์‚ฌ๋žŒ๋“ค์ด ์“ฐ๋Š” ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์ธ ๋“ฏ ํ•˜๋‹ค. > arjun30.medium.com/webview-data-directory-for-android-9-pie-d9744a1404e9

 

Webview data directory for Android 9 (Pie)

From Crashlytics report, i got to know that my app is crashing on Android 9 devices. After checking stacktrace log, it was related to…

arjun30.medium.com