我有各種使用DatePicker
的佈局,突然間佈局編輯器停止工作以顯示呈現錯誤。 如果我關閉自定義視圖渲染沙箱,則佈局會呈現正確;然而由於我沒有改變任何東西,所以不清楚這個問題的原因,並且在錯誤之前我不需要關閉渲染沙箱。DatePicker導致在LayoutEditor中呈現期間引發異常
完整的錯誤堆棧:
Exception raised
during rendering
:
Write access
not allowed
at com(user.timezone)
at com
.android.ide.common.rendering.RenderSecurityException.create(RenderSecurityException.java:52)
at java
.android.ide.common.rendering.RenderSecurityManager.checkPermission(RenderSecurityManager.java:616)
at com
.util.TimeZone.setDefault(TimeZone.java:713)
at libcore
.ibm.icu.util.TimeZone.setDefault(TimeZone.java:973)
at libcore
.icu.DateIntervalFormat_Delegate.createDateIntervalFormat(DateIntervalFormat_Delegate.java:61)
at libcore
.icu.DateIntervalFormat.createDateIntervalFormat(DateIntervalFormat.java:-1)
at libcore
.icu.DateIntervalFormat.getFormatter(DateIntervalFormat.java:112)
at libcore
.icu.DateIntervalFormat.formatDateRange(DateIntervalFormat.java:102)
at android
.icu.DateIntervalFormat.formatDateRange(DateIntervalFormat.java:71)
at android
.text.format.DateUtils.formatDateRange(DateUtils.java:826)
at android
.text.format.DateUtils.formatDateRange(DateUtils.java:651)
at android
.text.format.DateUtils.formatDateRange(DateUtils.java:628)
at android
.widget.CalendarView.setMonthDisplayed(CalendarView.java:1258)
at android
.widget.CalendarView.goTo(CalendarView.java:1131)
at android
.widget.CalendarView.<init>(CalendarView.java:414)
at java
.widget.CalendarView.<init>(CalendarView.java:333)
at android
.lang.reflect.Constructor.newInstance(Constructor.java:408)
at android
.view.LayoutInflater.createView(LayoutInflater.java:594)
at android
.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
at android
.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
at android
.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)
at android
.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android
.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android
.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android
.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android
.widget.DatePicker.<init>(DatePicker.java:175)
at java
.widget.DatePicker.<init>(DatePicker.java:149)
at android
.lang.reflect.Constructor.newInstance(Constructor.java:408)
at android
.view.LayoutInflater.createView(LayoutInflater.java:594)
at android
.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
at android
.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
at android
.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)
at android
.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android
.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android
.view.LayoutInflater.rInflate_Original(LayoutInflater.java:758)
at android
.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android
.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android
.view.LayoutInflater.rInflate_Original(LayoutInflater.java:758)
at android
.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android
.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android
.view.LayoutInflater.rInflate_Original(LayoutInflater.java:758)
at android
.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android
.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android
.view.LayoutInflater.rInflate_Original(LayoutInflater.java:758)
at android
.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android
.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android
.view.LayoutInflater.rInflate_Original(LayoutInflater.java:758)
at android
.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android
.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android
.view.LayoutInflater.inflate(LayoutInflater.java:492)
Copy stack
during rend
.view.LayoutInflater.inflate(LayoutInflater.java:373)
to clipboardering(user.timezone)Turn off custom view rendering sandbox Write access not allowed during rendering
後,我想知道爲什麼它的需要這個,如果之前工作也與默認的沙箱狀態,並沒有任何改變 – Silverstorm