0

I'm trying to do cordova build android, it fails with

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

Could not resolve all task dependencies for configuration ':debugCompileClasspath'. Could not resolve project :CordovaLib. Required by: project : Project : declares a dependency from configuration 'debugCompile' to configuration 'debug' which is not declared in the descriptor for project :CordovaLib.

I came to know that if I replace these two lines

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

with this in android studio(directly in build.gradle)

compile project(':CordovaLib')

then it works, I mean it builds. But as the project is in Ionic / Cordova, when I try to build it with cordova build android, it fails with above error again, as the changes gets overwritten by Gradlebuilder.js file back to the above 2 lines debug & releasecompile.

I want to know what & where should I make changes in gradlebuilder.js, so I get those 2 lines replaced by

compile project(':CordovaLib')

Any help is appreciated.

Check Manmohan Pal's answer here.

PhpCoder
  • 427
  • 6
  • 20

1 Answers1

0

I know that your question was 9 months ago, but I have the same problem and I have resolved the problem.

So, like you says, with Cordova the file build.gradle always override again and delete the new line compile project(':CordovaLib').

Well, the solution is modify the builder gradle in the path {PROJECT}/platforms/android/cordova/lib/builders/GradleBuilder.js and you must be to find the lines debugCompile, releaseCompile and comment and write the new line.

enter image description here

Cristan
  • 12,083
  • 7
  • 65
  • 69