hanzhanfei
hanzhanfei
采纳率0%
2019-01-25 17:53 阅读 1.0k

格式化日期在8.0手机报java.lang.AssertionError

5

格式化日期在8.0手机报java.lang.AssertionError

#648 Thread-20

java.lang.AssertionError

No NameTypeIndex match for SHORT_STANDARD
1 android.icu.impl.TimeZoneNamesImpl$ZNames.getNameTypeIndex(TimeZoneNamesImpl.java:724)
2 android.icu.impl.TimeZoneNamesImpl$ZNames.getName(TimeZoneNamesImpl.java:790)
3 android.icu.impl.TimeZoneNamesImpl.getTimeZoneDisplayName(TimeZoneNamesImpl.java:183)
4 android.icu.text.TimeZoneNames.getDisplayName(TimeZoneNames.java:261)
5 java.text.SimpleDateFormat.subFormat(SimpleDateFormat.java:1296)
6 java.text.SimpleDateFormat.format(SimpleDateFormat.java:1004)
7 java.text.SimpleDateFormat.format(SimpleDateFormat.java:974)
8 java.text.DateFormat.format(DateFormat.java:341)
9 com.platform.APIClient.authenticateRequest(Unknown Source:72)
10 com.platform.APIClient.sendHttpRequest(Unknown Source:115)
11 com.platform.APIClient.sendRequest(Unknown Source:1)
12 com.platform.UserMetricsManager.makeUserMetricsRequest(Unknown Source:101)
13 com.etzwallet.presenter.activities.util.ApplicationLifecycleObserver$1.run(Unknown Source:22)
14 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
15 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
16 com.etzwallet.tools.threads.executor.PriorityThreadFactory$1.run(Unknown Source:11)
17 java.lang.Thread.run(Thread.java:764)1 android.icu.impl.TimeZoneNamesImpl$ZNames.getNameTypeIndex(TimeZoneNamesImpl.java:724)
2 android.icu.impl.TimeZoneNamesImpl$ZNames.getName(TimeZoneNamesImpl.java:790)
3 android.icu.impl.TimeZoneNamesImpl.getTimeZoneDisplayName(TimeZoneNamesImpl.java:183)
4 android.icu.text.TimeZoneNames.getDisplayName(TimeZoneNames.java:261)
5 java.text.SimpleDateFormat.subFormat(SimpleDateFormat.java:1296)
6 java.text.SimpleDateFormat.format(SimpleDateFormat.java:1004)
7 java.text.SimpleDateFormat.format(SimpleDateFormat.java:974)
8 java.text.DateFormat.format(DateFormat.java:341)
9 com.platform.APIClient.authenticateRequest(Unknown Source:72)
10 com.platform.APIClient.sendHttpRequest(Unknown Source:115)
11 com.platform.APIClient.sendRequest(Unknown Source:1)
12 com.platform.UserMetricsManager.makeUserMetricsRequest(Unknown Source:101)
13 com.etzwallet.presenter.activities.util.ApplicationLifecycleObserver$1.run(Unknown Source:22)
14 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
15 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
16 com.etzwallet.tools.threads.executor.PriorityThreadFactory$1.run(Unknown Source:11)
17 java.lang.Thread.run(Thread.java:764)

下面是代码,
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
String httpDate = DATE_FORMAT.format(new Date());
根据 输出的提示就找到这些代码,并且报错的全部是8.0手机,并不是每台手机都报错,

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

相关推荐