Android Studio编译 Lib 包的时候报异常

  • Post author:
  • Post category:其他


Reason: Task ‘:xxxx:你的task’ uses this output of task ‘:xxx:syncReleaseLibJars’ without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

Possible solutions:

1. Declare task ‘:xxx:syncReleaseLibJars’ as an input of ‘:xxx:你的task’.

2. Declare an explicit dependency on ‘:xxx:syncReleaseLibJars’ from ‘:xxx:你的task’ using Task#dependsOn.

3. Declare an explicit dependency on ‘:xxx:syncReleaseLibJars’ from ‘:xxx:你的task’ using Task#mustRunAfter.

大概意思就是你的任务 依赖系统的任务 syncReleaseLibJars,但是你没有显式申明依赖系统的任务,这样会导致编译结果有可能出错。

解决办法:在你的task 参数中增加参数

dependsOn:build

task xxxx  (dependsOn:build ) {

}



版权声明:本文为u013171212原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。