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>'
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>'
19
Answers
In your build.gradle file where "dependencies" section is paste this:
in this section. And remove old strings with same text and other number versions. (in my case:
). Have worked for me.
source: https://github.com/facebook/react-native/issues/33926
I resolved it by replacing
implementation 'androidx.recyclerview:recyclerview:1.2.1'
instead ofimplementation 'com.google.android.material:material:1.7.0'
inbuild.gradle(:app)
That is caused by
1.7.0
:You better stick to
1.6.0
till they fix thisIn build.gradle(:app),
Updating, compileSdk and targetSdk to 33 helped me(from 32).
Upgraded android gradle plugin to 7.2.2 and the problem is solved. Try updating Android Studio too
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.
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
Upgraded android gradle plugin >= 7.1.0 and the problem is solved.
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):
This is also mentioned in their (updated) Getting Started guide (again, emphasis mine):
Updating the Android Gradle Plugin
You can update the Android Gradle plugin as follows:
Gradle
plugins
DSLThe plugin declaration can be found in the top-level
build.gradle
/build.gradle.kts
file:Buildscript classpath
Update the AGP
classpath
dependency (usually in the top-levelbuild.gradle
/build.gradle.kts
file):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.
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 :
And the project is perfectly working fine now.
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
I solved this by :
build.gradle
:implementation ‘androidx.appcompat:appcompat:1.4.1’
android:exported="true"
in ManifestUpgrade all libraries to latest version, don’t downgrade all libraries version, just update distributionUrl to latest version too in gradle-wrapper.properties like this:
It worked for me.
Just go to this build.gradle and change your dependencies to this version:
To solve this I needed to amend the Gradle and main project manifest.
Gradle changes:
Android Manifest under activity: Add this :
Update your Android Studio
Upgrade your classpath to
Android Gradle Plugin up to 7.2.0
Gradle up to 7.3.3
it work for me, see pic blow
github dicr
In my case, I deleted the code below and wrote it as follows, and it was solved.
Code before modifying:
Code after modifying: