从Github把MVP架构的示例工程荡下来看看,结果运行报如下错误,资源ID的R文件也无法自动生成。
Information:Gradle tasks [:app:generateMockDebugSources, :app:prepareMockDebugUnitTestDependencies, :app:mockableAndroidJar, :app:generateMockDebugAndroidTestSources]
Error:Failed to crunch file C:\Users\Administrator\Downloads\android-architecture-todo-mvp\android-architecture-todo-mvp\todoapp\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\24.2.0\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into C:\Users\Administrator\Downloads\android-architecture-todo-mvp\android-architecture-todo-mvp\todoapp\app\build\intermediates\res\merged\mock\debug\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png
Error:Execution failed for task ':app:mergeMockDebugResources'.
> Error: Failed to crunch file C:\Users\Administrator\Downloads\android-architecture-todo-mvp\android-architecture-todo-mvp\todoapp\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\24.2.0\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into C:\Users\Administrator\Downloads\android-architecture-todo-mvp\android-architecture-todo-mvp\todoapp\app\build\intermediates\res\merged\mock\debug\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png
Information:BUILD FAILED
原因竟然是windows系统的文件路径(含文件名)不能超过240个字符。