Build order problem upgrading build tools from 7.0.4 -> 7.2.2

Hi,

I’m trying to update the Gradle build chain in the mobile app framework Titanium. It is a big project and I don’t know all the workflow details but hopefully I can explain it :slight_smile:

The current version is com.android.tools.build:gradle:7.0.4 declared in this file: titanium_mobile/build.gradle at master · tidev/titanium_mobile · GitHub and it builds fine.

To build it: clone the repo, npm i && npm run cleanbuild android.

If change raise the version to 7.2.2 I’ll end up with this error:

> Task :titanium:configureCMakeRelWithDebInfo[arm64-v8a] FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':titanium:configureCMakeRelWithDebInfo[arm64-v8a]'.
> [CXX1409] titanium_mobile/android/titanium/.cxx/RelWithDebInfo/1wm6n2l3/arm64-v8a/android_gradle_build.json release|arm64-v8a : expected buildFiles file 'titanium_mobile/android/runtime/v8/generated/CMakeLists.txt' to exist

My guess is that there is a problem with the order of gradle tasks. I’m not sure how to debug it but it looks like this part:

is not created to have the CMakeList file ready.

Hope this makes sense and someone can help me to fix the issue.

Thanks

I have no idea about Android as I’m not doing Android development, you might have more luck asking in some Android community.

But regarding the snippet you showed, I think that is majorly wrong any way.
You configure each and every JavaCompile task to finally do as additional action that node call and depend on those two other tasks.
It is very unlikely that this is what you really want or should do.
You should probably instead create a separate task doing that node call and maybe configure the respective tasks to be finalized by that task. But hard to say without knowing what that action does. If it actually modifies the output files of the JavaCompile tasks having it as doLast action might be correct, but even then you should probabyl have different invocations per compile task.

Thanks for the infos! I’ll check it and ask some other Android devs about it :+1:

1 Like