Android Studio 執行 Unit Test 報錯 Command line is too long
環境 :
Android Studio 4.1
執行 Unit Test 後,terminal 出現以下錯誤
Error running ‘DateConverterTest.fromTimestamp’: Command line is too long.
Shorten command line for DateConverterTest.fromTimestamp or also for Android JUnit default configuration.
解決辦法:
1. 左上角檔案瀏覽選項切換到 “Project”
2. 打開 .idea 目錄底下的 workspace.xml
3. 找到 <component name=”PropertiesComponent”>
4. 裡面加入以下屬性
<property name=”dynamic.classpath” value=”true” />
5. 執行測試就 OK了
Reference:
https://blog.csdn.net/ZXJ_1223/article/details/80611089