skip to Main Content

I’m having a problem with running my android app:

Can't determine type for tag '<macro name="m3_comp_bottom_app_bar_container_color">?attr/colorSurface</macro>'

enter image description here

19

Answers


  1. In your build.gradle file where "dependencies" section is paste this:

    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.6.0'
    

    in this section. And remove old strings with same text and other number versions. (in my case:

    implementation 'androidx.appcompat:appcompat:1.5.1'    
    implementation 'com.google.android.material:material:1.7.0'
    

    ). Have worked for me.

    source: https://github.com/facebook/react-native/issues/33926

    Login or Signup to reply.
  2. I resolved it by replacing implementation 'androidx.recyclerview:recyclerview:1.2.1' instead of implementation 'com.google.android.material:material:1.7.0' in build.gradle(:app)

    Login or Signup to reply.
  3. That is caused by 1.7.0:

    implementation 'com.google.android.material:material:1.7.0'
    

    You better stick to 1.6.0 till they fix this

    implementation 'com.google.android.material:material:1.6.0'
    
    Login or Signup to reply.
  4. In build.gradle(:app),

    Updating, compileSdk and targetSdk to 33 helped me(from 32).

    Login or Signup to reply.
  5. Upgraded android gradle plugin to 7.2.2 and the problem is solved. Try updating Android Studio too

    Login or Signup to reply.
  6. update your build.gradle file as below:
    classpath 'com.android.tools.build:gradle:7.2.1'
    It will fix the issues, remember v7.3.x wont fix the issue, so stick to 7.2.1 as of now.

    Login or Signup to reply.
  7. For Flutter User with this issue this is how you solve it::

    Goto : build.gradle
    change "classpath 'com.andriod.tools.build:gradle:5.6.0'"

    to

    "classpath 'com.andriod.tools.build:gradle:<latest version>'"

    in my case :: classpath 'com.android.tools.build:gradle:7.2.1'

    then goto :: android/gradle/wrapper/gradle-wrapper.properties

    then change

    distributionUrl=https://services.gradle.org/distributions/gradle-5.4.3-all.zip

    to

    distributionUrl=https://services.gradle.org/distributions/gradle-<latest>-all.zip

    in my case distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-all.zip

    Login or Signup to reply.
  8. Upgraded android gradle plugin >= 7.1.0 and the problem is solved.

    classpath "com.android.tools.build:gradle:7.1.0"
    
    Login or Signup to reply.
  9. Rationale

    To expand on the existing answers, the release notes for Material Components for Android 1.7.0 mentions that they have updated the minimum requirements for your project (emphasis mine):

    New minimum requirements for your app’s project:

    This is also mentioned in their (updated) Getting Started guide (again, emphasis mine):

    5. Gradle, AGP, and Android Studio

    When using MDC-Android version 1.7.0-alpha02 and above, you will need to make sure your project is built with the following minimum requirements, in order to support the latest build features such as XML macro:

    Updating the Android Gradle Plugin

    You can update the Android Gradle plugin as follows:

    Gradle plugins DSL

    The plugin declaration can be found in the top-level build.gradle/build.gradle.kts file:

    plugins {
        // Or "com.android.library"
        id("com.android.application") version "7.2.2" apply false
    }
    

    Buildscript classpath

    Update the AGP classpath dependency (usually in the top-level build.gradle/build.gradle.kts file):

    classpath("com.android.tools.build:gradle:7.2.2")
    
    Login or Signup to reply.
  10. After wasting 2 hours and ruining my mood solution was simply upgrading your android studio version, most probably you are using an older version like Arctic fox or something like that, upgrade to dolphin or something higher. Hope it help, and yes in dolphin version it will give error of 30.0.3 but don’t worry it gives you an attached link to install 30.0.0 SDK in console itself, so chill and keep developing.

    Login or Signup to reply.
  11. In order to get over with this. Upgrade to the latest gradle version as well as latest Android Studio.

    I was also facing this issue and I followed these steps :

    • Upgraded Android Studio to Android Studio Dolphin | 2021.3.1 Patch 1
    • gradle version to 7.3.1 in project build.gradle
    • kotlin version to 1.7.20 in project build.gradle
    • targetSdkVersion and compileSdkVersion to 33
    • latest version of dependencies in app’s build.gradle

    And the project is perfectly working fine now.

    Login or Signup to reply.
  12. first, in the gradle build file, change the implementation from 1.7.0 to 1.6.0

    Next, open the colors file and change the color of the tag (#) which has 7 digits to a 6 digit tag. Because usually the default color of tags on Android Studio is sometimes 7 digits or 6 digits

    Login or Signup to reply.
  13. I solved this by :

    1. Adding in build.gradle:

    implementation ‘androidx.appcompat:appcompat:1.4.1’

       implementation 'com.google.android.material:material:1.5.0'
    
    1. adding android:exported="true" in Manifest
    Login or Signup to reply.
  14. Upgrade all libraries to latest version, don’t downgrade all libraries version, just update distributionUrl to latest version too in gradle-wrapper.properties like this:

    distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-bin.zip
    

    It worked for me.

    Login or Signup to reply.
  15. enter image description here

    Just go to this build.gradle and change your dependencies to this version:

     implementation 'androidx.appcompat:appcompat:1.5.1'
     implementation 'com.google.android.material:material:1.6.1'**
    
    Login or Signup to reply.
  16. To solve this I needed to amend the Gradle and main project manifest.

    Gradle changes:

    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.6.0'
    
    compileSdkVersion 31
    targetSdkVersion 31
    

    Android Manifest under activity: Add this :

    android:exported="false"
    
    Login or Signup to reply.
    1. Update your Android Studio

    2. Upgrade your classpath to

      classpath 'com.android.tools.build:gradle:7.2.2'
      
    Login or Signup to reply.
  17. Android Gradle Plugin up to 7.2.0
    Gradle up to 7.3.3
    it work for me, see pic blow

    github dicr

    Login or Signup to reply.
  18. In my case, I deleted the code below and wrote it as follows, and it was solved.

    Code before modifying:

    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    

    Code after modifying:

    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search