Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failed for IdentityTransform, File/directory does not exist: intermediates/runtime_library_classes_jar/release/classes.jar #103

Open
malcolmn-sq opened this issue Dec 6, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@malcolmn-sq
Copy link

malcolmn-sq commented Dec 6, 2022

Current behavior

Plugin cannot find classes.jar

Failed to transform classes.jar (project :features:checkout-v2-data:cash-drawer:public) to match attributes {artifactType=android-classes, com.android.build.api.attributes.AgpVersionAttr=7.2.2, com.android.build.api.attributes.BuildTypeAttr=release, com.android.build.gradle.internal.attributes.VariantAttr=release, org.gradle.category=library, org.gradle.jvm.environment=android, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}.
      > Execution failed for IdentityTransform: /Users/malcolmn/Development/android-register/features/checkout-v2-data/cash-drawer/public/build/intermediates/runtime_library_classes_jar/release/classes.jar.
         > File/directory does not exist: /Users/malcolmn/Development/android-register/features/checkout-v2-data/cash-drawer/public/build/intermediates/runtime_library_classes_jar/release/classes.jar

Expected behavior

Plugin should be able to find classes.jar

Steps to reproduce

./gradlew analyzeReleaseBundle & ./gradlew analyzeDebugBundle

Versions

AGP = 7.2.2
Gradle = 7.5
Ruler = 1.4.0

Anything else?

It looks like DependencyParser is looking at RuntimeClasspath, but it seems like for our project and sub projects we are only generating CompileClasspath for certain modules. Should we update DependencyParser to look at other places for classes.jar, or change our build scripts to also generate the runtimeClasspath jars for each module?

@malcolmn-sq malcolmn-sq added the bug Something isn't working label Dec 6, 2022
@nathan3d
Copy link
Collaborator

Hi @malcolmn-sq!

Could you share a bit more of what your Gradle setup looks like for both the app and library projects?

We're having trouble reproducing the issue.

@malcolmn-sq
Copy link
Author

Hi @nathan3d It looks like within our own project, we are either creating a fat jar outside of where DependencyParser is looking or not generating the RuntimeClasspath classes.jar, instead using CompileClasspath. Is there a way to normalize this?

@nathan3d
Copy link
Collaborator

I'm not sure what the solution is yet, so far everything I've tried still results in generating the runtime classes.jar. Any way you can provide a sample project or more details on the setup?

@malcolmn-sq
Copy link
Author

I think what was happening was that our project's build never resolved any internal dependencies. I was able to fix this by removing the filter, but is it possible for ruler to enforce/generate runtimeClasspath dependencies in its own step?

  fun Configuration.externalArtifactViewOf(
    attrValue: String
  ): ArtifactView = incoming.artifactView { view ->
    view.attributes.attribute(attributeKey, attrValue)
    // If some dependency doesn't have the expected attribute, don't fail. Continue!
    view.lenient(true)
    // Only resolve external dependencies! Without this, all project dependencies will get _compiled_.
    view.componentFilter { id -> id is ModuleComponentIdentifier }
  }

@nathan3d
Copy link
Collaborator

@malcolmn-sq If you'd like to create a PR for this, would be happy to merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants