在studio中想要測試某個功能直接執(zhí)行main()方法報錯如下:
* What went wrong:
A problem occurred configuring project ':app'.
> Could not create task ':app: **** .main()'.
? > SourceSet with name 'main' not found.
解決方案:
1. 執(zhí)行run ** main() with Coverage;
2. 修改.idea下的gradle.xml
<GradleProjectSettings>標(biāo)簽節(jié)點下添加一行
<option name="delegatedBuild" value="false" />
保存,即可使用run ** with?main() 和 debug ** with main()?
錯誤: ?Command line is too long. Shorten command line for? **
有人在上面蓋了gradle.xml之后運行main方法又報如下錯誤:
Error running ' ** ': Command line is too long. Shorten command line for? **? or also for Application default configuration.
解決方案:
?修改.idea下的workspace.xml
找到<component name="PropertiesComponent">標(biāo)簽節(jié)點并在之下添加一行
<property name="dynamic.classpath" value="true" />
然后保存即可速兔。