Closed oakkitten closed 1 year ago
Hi @oakkitten - I remember a similar issue that was only happening on Windows machines due to the '/' '\' file path separator differences. It should be fixed now, however for some reason you seem to be getting the same issue.
In order to know what could be happening, I'm going to need the --info
console output for when you build your project for both cases, when it works (after a clean) and when it doesn't. In order to get this console output, you need to build your project this way: ./gradlew :AnkiDroid:assembleAmazonDebug --info
Please let me know if any questions.
Sure, here's the logs. Just say if you need anything else.
./gradlew :AnkiDroid:assembleAmazonDebug --info
after doing ./gradlew clean
, removing ~/.gradle/caches/build-cache-1
and killing the daemon${}
.Hi @oakkitten - Thanks for the info. I was checking it out and I noticed that it all seems to be working well in terms of normal Stem execution, I can tell this because on the 3rd file, line 1437, it reads: Task ':AnkiDroid:resolveAmazonDebugPlaceholders' is not up-to-date because:
followed by the files changed after you modified a string with ${}
, meaning that, the resolving process did run and the overall output of Stem should be updated after that.
Now, I did find something that could be the problem you're facing, in the 1st file on line 12343, I see this line: - Gradle detected a problem with the following location: 'C:\Users\s\StudioProjects\Anki-Android\AnkiDroid\build\generated\resolved\amazonDebug'. Reason: Task ':AnkiDroid:extractDeepLinksAmazonDebug' uses this output of task ':AnkiDroid:resolveAmazonDebugPlaceholders' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.5.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Based on that, it seems like there's a task in your project named extractDeepLinksAmazonDebug
that is gathering Stem's output without explicitly declaring them as its inputs. I recommend you to follow the link above to see what are your options to solve it. I think it should simply be a matter of adding the dependency on Stem's task like so: extractDeepLinksAmazonDebug.dependsOn("resolveAmazonDebugPlaceholders")
in your build.gradle file.
I hope it helps.
I tried adding the following into the app gradle file
afterEvaluate {
tasks.getByPath(':AnkiDroid:extractDeepLinksAmazonDebug').dependsOn(':AnkiDroid:resolveAmazonDebugPlaceholders')
}
This does get rid of the warning, but otherwise does not help. 😔
I also ran the task tree tool. This is probably obvious for anyone who made a gradle plugin, but it seems that processAmazonDebugResources
depends on mergeAmazonDebugResources
and that depends on resolveAmazonDebugPlaceholders
. Somehow even though the resolve
task does run and produces a correct resolved.xml
file, and also merge
task runs, the process
task seems to remain UP-TO-DATE.
I see, it seems like your task to extract deeplinks might not be properly wired into the Gradle task graph. I'd say the best way to connect tasks is by connecting their outputs/inputs, as explained here: https://docs.gradle.org/current/userguide/lazy_configuration.html#working_with_task_dependencies_in_lazy_properties
Since the overall Stem work is done properly, I'm going to close this ticket.
Hm, I suppose that would mean there's a bug in AGP, then? Is this something that we could report to Google?
It depends on what your task is supposed to do, if it's gathering all the resources from your app, then I'd recommend taking a look at the AGP API to see if they have a native way of providing them. They used to provide it, however, they've changed their API a lot starting from AGP 7, so I'd recommend you to first take a look at their new APIs and check if there's a 'native' way from the AGP to provide your task with the project's resources, if there isn't, then I guess you could open an issue about it on Google, since they used to provide that option with their old API.
Oh! I see, I wasn't aware of it. I'll take a deeper look at that task to see if it's possible to properly connect it to Stem.
Hi @oakkitten - I've just released version 2.3.0
to make Stem aware of the "extractDeeplinks" task, so you will no longer see the warnings, also, I've tested it with deeplinks and they keep up-to-date after changes to the templates or their values, even though the "extractDeeplinks" tasks doesn't run again, because what it seems to do is to set deeplinks to strings ID references rather than values, so if the value of a string changes but its ID doesn't, then the extractDeepkinks task doesn't have anything to change. Please let me know if you find any issues related to deeplinks.
I tried using this lovely plugin in a project I'm working on, and I ran into a problem. It works, but only once after cleaning the project (
./gradlew clean
) and removing build cache (.gradle/caches/build-cache-1
). This happens 100% of the time. For some reason the tasks that depend on this plugin's tasks appearUP-TO-DATE
. This just might be a problem with the project, but I have no idea how to even begin tackling it.Here's the commit where I added the plugin. (Note that while the project is easy to build it needs some 5GB+ of dependencies.) Below is the output of a build which I ran after changing a single sting that has
${}
in it. Windows 10 here, if that matters, and Gradle 7.5.1.