ThreeTen 向后移植导致仅在某些设备上运行时

ThreeTen Backport causing runtime only on some devices

提问人:Tyler 提问时间:3/1/2019 更新时间:3/1/2019 访问量:419

问:

这个痕迹对任何人来说都熟悉吗?它只发生在少数设备上。ThreeTenBP 是依赖中的依赖。

10:16:33 E AndroidRuntime : java.util.ServiceConfigurationError: org.threeten.bp.zone.ZoneRulesProvider: Provider org.threeten.bp.zone.TzdbZoneRulesProvider not found
10:16:33 E AndroidRuntime : at java.util.ServiceLoader.fail(ServiceLoader.java:233)
10:16:33 E AndroidRuntime : at java.util.ServiceLoader.access$100(ServiceLoader.java:183)
10:16:33 E AndroidRuntime : at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:373)
10:16:33 E AndroidRuntime : at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:416)
10:16:33 E AndroidRuntime : at java.util.ServiceLoader$1.next(ServiceLoader.java:494)
10:16:33 E AndroidRuntime : at org.threeten.bp.zone.ZoneRulesInitializer$ServiceLoaderZoneRulesInitializer.initializeProviders(ZoneRulesInitializer.java:123)
10:16:33 E AndroidRuntime : at org.threeten.bp.zone.ZoneRulesInitializer.initialize(ZoneRulesInitializer.java:89)
10:16:33 E AndroidRuntime : at org.threeten.bp.zone.ZoneRulesProvider.<clinit>(ZoneRulesProvider.java:82)
10:16:33 E AndroidRuntime : at org.threeten.bp.zone.ZoneRulesProvider.getRules(Unknown Source:0)
10:16:33 E AndroidRuntime : at org.threeten.bp.ZoneRegion.ofId(ZoneRegion.java:143)
10:16:33 E AndroidRuntime : at org.threeten.bp.ZoneId.of(ZoneId.java:358)
10:16:33 E AndroidRuntime : at org.threeten.bp.ZoneId.of(ZoneId.java:286)
10:16:33 E AndroidRuntime : at org.threeten.bp.ZoneId.systemDefault(ZoneId.java:245)
10:16:33 E AndroidRuntime : at org.threeten.bp.Clock.systemDefaultZone(Clock.java:137)
10:16:33 E AndroidRuntime : at org.threeten.bp.LocalDate.now(LocalDate.java:165)
安卓 ThreeTenBP

评论


答:

3赞 Tyler 3/1/2019 #1

添加了 proguard 规则:

-keep class org.threeten.bp.zone.*

似乎已经修好了!

评论

0赞 Max Pinto 6/28/2019
谢谢,proguard 规则缺少:(