GradleUp/auto-manifest

Build randomly fails

Closed this issue · 9 comments

Love the idea of the plugin but I get the following error on clean builds from CLI (and therefore CI):

Could not determine the dependencies of task ':features:core-ui:compileDebugJavaWithJavac'.
> Could not create task ':features:core-ui:kaptDebugKotlin'.
   > Manifest file does not exist: /opt/****/workspace/Android-pipeline/features/core-ui/build/generated/auto-manifest/AndroidManifest.xml

I have to run the task from Android Studio for it to pass. I haven't been able to find any configuration differences between the two builds. Any ideas?

Very interesting. I have the sample project that builds on the CI.

I only tested it with stable Android Gradle Plugin so far. Are you using the beta version?

Hi, sorry for not getting back to this earlier. I tried to reproduce this in my projects but I unfortunately cannot.

If you can give me a sample project, that would be very nice.

I can't share the project but can't reproduce on others. I can we can just close. I'll reopen if I get time to dig deeper and figure out why it might be happening.

Hey, I figured out how to reproduce. There's some conflict with Android databinding and kapt.

If you add the kotlin("kapt") plugin and enable dataBinding, even a clean fails with manifest not found.

android {
      ....
      buildFeatures {
        dataBinding = true
    }
}

I can share I have experienced similar sounding issues with kapt and databinding. I've been using this plugin successfuly in my private projects, and it works really great. I wanted give it a go and also migrate another, larger project that leverages databinding. I applied the plugin and that's the moment I stopped having stable builds 💥

After a bit of digging I was able to narrow it down to the mere fact the manifest package changes. In my case applying the plugin changes package names from com.example.mypackage to com.example.my_package, which appareantly doesn't play well with databinding.
Given the fact the plugin doesn't have to be applied and I was able to reproduce the issue both locally and on CI - I reported the issue directly to Google https://issuetracker.google.com/issues/208855057 🤷
I haven't seen Manifest file does not exist error though

btw Thank you for this great plugin, I really respect the idea and appreciate the fact you made it open-source!

Thanks for sharing. I will try to deep dive and see what I can do to fix. It is a tricky one actually. I have some ideas in mind but those might not be good since I want to keep this plugin lazy to keep build performance at a good level.

For the specific package name issue, you can override the package names per module. This might help prevent the conflict with databinding

Hey folks, it is a bit hard to solve this issue. To handle such edge-cases, I introduced disable() function with the new version. Using this, you can disable auto manifest generation for the modules where you have databinding enabled.

Databinding is considered deprecated so I'm not sure if I will invest time to fix it just for databinding. Thanks for understanding.

@tasomaniac thanks for the effort, I agree it's not worth the effort with databinding at this piont.