Flutter构建在Ubuntu 19.10中失败

时间:2019-12-14 03:12:14

标签: android gradle flutter

我有一个Flutter应用程序,可以在另一台机器上完美构建(ubuntu 18.04)。现在我正在使用ubuntu 19.10,当我尝试使用flutter run命令运行此应用程序时,它会引发以下错误:

Launching lib/main.dart on Primo EF6 in debug mode...

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Cannot create service of type PayloadSerializer using ToolingBuildSessionScopeServices.createPayloadSerializer() as there is a problem with parameter #2 of type PayloadClassLoaderFactory.
> Cannot create service of type PayloadClassLoaderFactory using ToolingBuildSessionScopeServices.createClassLoaderFactory() as there is a problem with parameter #1 of type CachedClasspathTransformer.

* 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                              

BUILD FAILED in 4s                                                      
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                         5.5s
Gradle task assembleDebug failed with exit code 1

我认为这是问题。我正在使用flutter v1.12.13 + hotfix.6

1 个答案:

答案 0 :(得分:2)

解决了这个问题。 .gradle目录上有一个权限问题,它是readonly。因此,更改权限可以解决此问题。