Code Monkey home page Code Monkey logo

Comments (14)

autonomousapps avatar autonomousapps commented on September 25, 2024

Thanks for the issue!

Hopefully the build scan will be enough, but do you have a minimal reproducer? Those repro steps don't look sufficient to me.

from dependency-analysis-gradle-plugin.

gabrielittner avatar gabrielittner commented on September 25, 2024

I've got a reproducer, this is a new project created with Android Studio Hedgehog with the only change being that I added this plugin MyApplication.zip

from dependency-analysis-gradle-plugin.

ZacSweers avatar ZacSweers commented on September 25, 2024

Here's another repro, just uncomment the commented out enabling of DAGP in the root build.gradle.kts: https://github.com/ZacSweers/CatchUp

from dependency-analysis-gradle-plugin.

autonomousapps avatar autonomousapps commented on September 25, 2024

Duplicates #1112.

from dependency-analysis-gradle-plugin.

autonomousapps avatar autonomousapps commented on September 25, 2024

I've got a reproducer, this is a new project created with Android Studio Hedgehog with the only change being that I added this plugin MyApplication.zip

@gabrielittner I downloaded this zip and ran buildHealth on it and there were no errors. Is there something I'm missing?

from dependency-analysis-gradle-plugin.

gabrielittner avatar gabrielittner commented on September 25, 2024

I can still reproduce it when I download the zip and run buildHealth. However after deleting ~/.android/analytics.settings it doesn't reproduce anymore and as soon as the file is recreated it's happening again. Just the existence of the file seems to be enough, so you should be able to reproduce it by just creating it without content.

from dependency-analysis-gradle-plugin.

autonomousapps avatar autonomousapps commented on September 25, 2024

how is that file used? I'm not familiar with it. do you have an example with actual content? links to documentation?

from dependency-analysis-gradle-plugin.

autonomousapps avatar autonomousapps commented on September 25, 2024

I just checked and I already have such a file in my environment. The contents of it are

{"userId":"73484633-8bc3-4f83-9fcb-edcf4ec64b4e","hasOptedIn":false,"debugDisablePublishing":false,"saltValue":0,"saltSkew":-1}

from dependency-analysis-gradle-plugin.

gabrielittner avatar gabrielittner commented on September 25, 2024

Mine looks the same and it's created/updated when you toggle "send usage statistics to Google" in Android Studio, other than that I don't know more about it. I was just thinking about it since the issue is analytics related. For me it happens regadless of whether "hasOptedIn" is true or false but maybe changing it true will help reproducing it?

from dependency-analysis-gradle-plugin.

autonomousapps avatar autonomousapps commented on September 25, 2024

I changed the value to true and reran buildHealth (with --rerun-tasks) and it worked fine 🤷

Have you tried with rerun-tasks?

from dependency-analysis-gradle-plugin.

gabrielittner avatar gabrielittner commented on September 25, 2024

--rerun-tasks didn't help. I tried aroudn a bit more and it looks like you need to kill the daemon after changing hasOptedIn or generally use --no-daemon for the change to take effect.

from dependency-analysis-gradle-plugin.

autonomousapps avatar autonomousapps commented on September 25, 2024

--no-daemon did it 🤔

Ok, so, to reproduce this error, it looks like at least two things need to be true:

  1. set hasOptedIn to true
  2. Run with --no-daemon ==> ./gradlew :app:explodeXmlSourceDebugTest --no-daemon
  3. ???

I note that this doesn't fail with the :app:explodeXmlSourceDebug task (for the main source set), nor does it fail for the :app:explodeXmlSourceDebugAndroidTest task (the androidTest source set). It's only failing for the test source set. I think this might relate to the Android unit tests not having resources enabled, and DAGP not handling that properly.

Further confirmation, the success cases all have tasks like :app:generateDebugAndroidTestResValues and :app:generateDebugResValues. There however is no task named :app:generateDebugTestResValues. (type: com.android.build.gradle.tasks.GenerateResValues.)

from dependency-analysis-gradle-plugin.

autonomousapps avatar autonomousapps commented on September 25, 2024

I can eliminate the error by basically commenting out this method body for android unit tests. Given the whole chain is nullable, it is bizarre to me that this happens. It looks like an AGP bug.

  override fun getAndroidRes(): Provider<Iterable<File>> {
    // return project.provider { emptyList() }
    return sources.res?.all
      ?.map { layers -> layers.flatten() }
      ?.map { directories ->
        directories.map { directory -> directory.asFileTree.matching(Language.filterOf(Language.XML)) }
      }
      ?.map { trees -> trees.flatten() }
      ?: project.provider { emptyList() }
  }

from dependency-analysis-gradle-plugin.

autonomousapps avatar autonomousapps commented on September 25, 2024

https://issuetracker.google.com/issues/325307775

from dependency-analysis-gradle-plugin.

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.