某日, 上班后发现,项目Debug环境可以正常运行, 在构建Release发布包的时候出现以下报错:
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app_mobilecare:transformClassesWithDesugarForRelease'. > com.android.build.api.transform.TransformException: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'D:Program FilesJavajdk1.8.0_77binjava.exe'' * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 2m 45s 1065 actionable tasks: 952 executed, 113 up-to-date 12:14:36: Task execution finished 'assembleRelease'.
解决方案:项目在电脑上的代码目录层级太深, 减少层级即可。
排错指令:gradlew assembleRelease --stacktrace --info
参考链接:CreateProcess error=206, 文件名或扩展名太长的问题 - 简书



