Skip to content

Material Components theme & attribute not found when using com.google.android.material #960

@arxmlbots

Description

@arxmlbots

I am using CodeAssist version 0.2.9 (Alpha pre-release) on Android.
When I try to build a project that uses com.google.android.material:material, the build fails with the following errors:

ERROR: resource dimen/design_snackbar_padding_vertical not found.
ERROR: resource style/Base.Theme.Material3.Dark.Dialog.FixedSize not found.
ERROR: resource style/Base.Theme.MaterialComponents.Dialog.FixedSize not found.
ERROR: style attribute 'attr/windowActionBar' not found.
ERROR: style attribute 'attr/windowNoTitle' not found.

Even a simple project with just an empty AppCompatActivity and Theme.AppCompat.Light.NoActionBar fails to link resources.

Environment:

  • CodeAssist version: 0.2.9 (Alpha pre-release)
  • Android version: Android 13 Go Edition
  • Project dependencies:

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'

Steps to reproduce:

  1. Create a new Empty Project.
  2. Add Material Design and AppCompat dependencies.
  3. Set theme to Theme.AppCompat.Light.NoActionBar or Theme.MaterialComponents.DayNight.
  4. Build the project.

Expected behavior:
The project should compile successfully without resource linking errors.

Actual behavior:
Resource linking fails with missing theme attributes and missing Material style references.

Additional notes:

  • The same code builds fine in Android Studio.
  • The issue might be related to how CodeAssist generates values.xml and R.txt for Material Components.
  • Possibly a bug in the AAPT2 or resource merger in the alpha version.

Thank you for your great work on CodeAssist!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions