【问题标题】:GradleBuilder.js replacing build.gradleGradleBuilder.js 替换 build.gradle
【发布时间】:2018-06-04 18:32:27
【问题描述】:

我正在尝试做cordova build android,它失败了

Could not determine the dependencies of task ':compileDebugJavaWithJavac'.

无法解析配置“:debugCompileClasspath”的所有任务依赖项。 无法解析项目:CordovaLib。 要求: 项目 : 项目:声明从配置“debugCompile”到配置“调试”的依赖关系,该依赖关系未在项目描述符中声明:CordovaLib。

我知道如果我替换这两行

debugCompile(project(path: "CordovaLib", configuration: "debug"))
releaseCompile(project(path: "CordovaLib", configuration: "release"))

在 android studio 中使用这个(直接在 build.gradle 中)

compile project(':CordovaLib')

然后它工作,我的意思是它构建。但是由于该项目位于 Ionic / Cordova 中,当我尝试使用 cordova build android 构建它时,它再次失败并出现上述错误,因为更改被 Gradlebuilder.js 文件覆盖,返回到上述 2 行调试和发布编译。

我想知道我应该在 gradlebuilder.js 中进行哪些更改以及在哪里进行更改,所以我将这两行替换为

compile project(':CordovaLib')

感谢任何帮助。

Check Manmohan Pal's answer here.

【问题讨论】:

    标签: android cordova android-gradle-plugin ionic3 build.gradle


    【解决方案1】:

    我知道您的问题是 9 个月前的问题,但我遇到了同样的问题,并且我已经解决了问题。

    所以,就像你说的,对于 Cordova,文件 build.gradle 总是会再次覆盖并删除新行 compile project(':CordovaLib')

    好吧,解决办法是修改路径{PROJECT}/platforms/android/cordova/lib/builders/GradleBuilder.js中的builder gradle,你必须找到debugCompilereleaseCompile这行,然后注释并写下新行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-29
      • 2020-06-06
      • 2023-02-10
      • 1970-01-01
      • 2023-02-01
      相关资源
      最近更新 更多