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

格式化日期在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手机,并不是每台手机都报错,

shuiheliancao
shuiheliancao 解决了吗?我也碰到这个问题了
一年多之前 回复

1个回答

hanzhanfei
hanzhanfei 这篇章发之前我也看了,没有找到解决的办法, 我不知道 minSdkVersion 21 targetSdkVersion 27
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问