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

Android assets are not accounted for #657

Closed
ZacSweers opened this issue May 6, 2022 · 3 comments · Fixed by #663
Closed

Android assets are not accounted for #657

ZacSweers opened this issue May 6, 2022 · 3 comments · Fixed by #663
Labels
bug Something isn't working enhancement New feature or request toolchain:android

Comments

@ZacSweers
Copy link
Contributor

Build scan link

Plugin version

1.1.0

Gradle version

7.4.2

(Optional) Android Gradle Plugin (AGP) version

7.1.3

Describe the bug

Android assets are not currently accounted for, so a project that contains assets only is determined to be compileOnly-safe to depend on.

To Reproduce
Steps to reproduce the behavior:

  1. Have an assets-only project with one kotlin file for compilation marker reasons (so IC data is generated)
  2. Depend on it in your top-level app project
  3. Run analysis in the app project and observe it suggests making it compile-only (interestingly not a removable dependency though?)

image

![image](https://user-images.githubusercontent.com/1361086/167045970-aa622b71-6870-4a64-b5b4-caf8769c5173.png)

Expected behavior

It should ideally detect usage or at least maybe not touch projects with assets since they're un-trackable

Additional context

@autonomousapps
Copy link
Owner

It's been a while, so I have to ask: how do you use an asset from another module? What does the code look like? This gets at the question: how would I track that an asset is used? From a packaging perspective, are all assets from all android libraries bundled into the final apk or aar?

@autonomousapps autonomousapps added bug Something isn't working enhancement New feature or request toolchain:android labels May 6, 2022
@ZacSweers
Copy link
Contributor Author

Here's an example snippet:

context.getAssets().open("some_icon.png")

Where getAssets() returns AssetManager: https://developer.android.com/reference/android/content/res/AssetManager

@autonomousapps
Copy link
Owner

Do you know any examples of published libraries that contain assets? Or is this only relevant for projects in a multi-project situation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request toolchain:android
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants