Giter VIP home page Giter VIP logo

Comments (5)

vRallev avatar vRallev commented on May 26, 2024

I wonder if you could provide a sample project? The worker API is enabled for this project, but I don't see the issue. Maybe it's related to Room?

from anvil.

rharter avatar rharter commented on May 26, 2024

You're right. While creating a minimally reproducible project, it looks like using gradle kts scripts is what changes things.

Attached is a project that reproduces the issue. There isn't even any consumption of code, it simply appears that using kts, kapt, and Hephaestus causes the problem.

Hephalumps.zip

To see the issue, run ./gradlew assemble in this project. To see the fix, alternate the comments in settings.gradle so the groovy based module2 is included instead of the kts based module1 is included.

from anvil.

vRallev avatar vRallev commented on May 26, 2024

I can reproduce the issue with your project. But I wasn't able to reproduce it in here. This definitely seems to be a Gradle issue and is maybe caused by the way plugins are applied.

You do this:

plugins {
    id("com.squareup.hephaestus").version("1.0.3")
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

I changed it to the following in all three modules and cannot reproduce the bug anymore:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.squareup.hephaestus'

I also tested the plugins syntax and the issue is gone:

plugins {
    id("kotlin")
    id("kotlin-kapt")
    id("com.squareup.hephaestus")
}

Only mixing the two seems to cause issues.

from anvil.

rharter avatar rharter commented on May 26, 2024

Hmm, that doesn't seem right. The code you're sharing looks like groovy (notice the single quotes).

In the example, the groovy modules aren't a problem, it's the kts build file that introduces the problem. (comment that out in settings.gradle and the problem goes away.)

Hephalumps 2.zip

Here's a new repro project with the updates you propose (changing all modules to use new plugin syntax) and the problem persists as long as you include the kts based module in the build.

from anvil.

vRallev avatar vRallev commented on May 26, 2024

Sharing zips isn't fun. This for some reason fixes the issue: https://github.com/vRallev/issue-33/commit/1befe3702c3b248c0f1344c5b699c3623cf10282

That's an interesting issue. I bet in my workaround Gradle doesn't change the classloader and the isAssignableFrom check you mentioned earlier is successful.

from anvil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.