No resource identifier found for attribute 'layout_behavior' in package

no resource identifier found for attribute 'requestlegacyexternalstorage' in package 'android'
no resource identifier found for attribute apktool
no resource identifier found for attribute 'adsize' in package
no resource identifier found for attribute 'networksecurityconfig' in package 'android'
no resource identifier found for attribute 'layout_constrainttop_totopof
no resource identifier found for attribute appcomponentfactory' in package 'android ionic 1
aapt error: attribute android boxededges not found
aapt: error: attribute android:requestlegacyexternalstorage not found

My application worked fine until I tried to add a library to it. After I added the library, Android Studio gives me the following error:

Error:(26) No resource identifier found for attribute 'layout_behavior' in package 'inf..'

This is my build.gradle file:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:support-v4:23.0.1'
    compile 'com.ogaclejapan.smarttablayout:utils-v4:1.3.0@aar'
    compile 'com.ogaclejapan.smarttablayout:library:1.3.0@aar'
    compile 'com.jpardogo.materialtabstrip:library:1.1.0'
    // compile 'com.lorentzos.swipecards:library:1.0.9@aar'
    compile 'com.android.support:cardview-v7:21.0.3'
    compile 'com.android.support:recyclerview-v7:21.0.3'
    compile 'com.melnykov:floatingactionbutton:1.3.0'
    compile project(':swipelib')
}

This is the xml which causes the error:

 <android.support.v4.view.ViewPager
    android:id="@+id/viewpager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

I tried the following:

  • Removed the library
  • Reset Android Studio and my computer
  • Reverted to previous version of my code from git.

However, the error persists. How do I resolve this?

That string resource is defined within the Material Design support library.

Since you're not using the CoordinatorLayout from the Material Design support library, you should be able to safely remove the app:layout_behavior attribute. It was probably cut & paste from other code.

NOTE: If you are actually using CoordinatorLayout and want the cooperative scrolling behaviors to work, you need to add the dependency for the latest version of the Material Design Support library to your Gradle build file:

compile 'com.android.support:design:23.0.1'

UPDATE: Note that with the latest versions of Gradle the compile configuration has been deprecated in favor of implementation and api configurations so your dependency could look like this:

implementation 'com.android.support:design:27.0.2'

This is only an example; the version numbers may be out of date when you read this, so make sure your version matches the version of the support library that you want to use.

For more info: What's the difference between implementation and compile in gradle

AndroidManifest.xml:17: error: No resource identifier found for , Solved: No resource identifier found for attribute 'configchanges' in package '​android'. November 20, 2019 Category: Xamarin. I was following the Xamarin  this video will help you to fix "No resource identifier found for attribute 'srcCompat' in package" common errors in Android studio #1 How to Fix Java compile error: "reached end of file while

Just in case someone else comes from Google and makes the same mistake I did, it's layout_behaviOr, not layout_behavioUr.

Solved: No resource identifier found for attribute 'configchanges' in , The com.admob.android.ads.AdView tag was giving messages: Multiple annotations found at this line: – error: No resource identifier found for attribute  No resource identifier found for attribute 'requestLegacyExternalStorage' in package 'android' whatsapp recompilation #2167 Open ale82to opened this issue Sep 10, 2019 · 5 comments

For those who use AndroidX and don't want to add the old library:

com.android.support:design:28.0.0

you can add instead:

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

and use it like this:

app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"

No resource identifier found for attribute « Learn Android The Easy , this video will help you to fix "No resource identifier found for attribute 'srcCompat' in package Duration: 2:54 Posted: May 28, 2017 Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more No resource identifier found for attribute 'showAsAction' in package 'android'

Note: The versions have changed by now, so replace below versions with the most recent ones.

The accepted answer gets rid of the error in case layout_behavior is not needed, however if you actually want to use:

app:layout_behavior="@string/appbar_scrolling_view_behavior"

Make sure to add the proper dependency to the build.gradle file of your module:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "21.1.2"

   //Other stuff....
}

dependencies {

    //Importing the design library fixes the build
    compile 'com.android.support:design:23.1.0'

    //Other libraries....
}

I.e. add this line to your dependencies:

compile 'com.android.support:design:23.1.0'

No resource identifier found for attribute 'srcCompat' in package , So I am getting the error "error: No resource identifier found for attribute 'TextView​' in package 'android'" I am really confused because when I looked up  Re: Cannot build android (No resource identifier found for attribute 'appComponentFactory' in package 'android') vangroover LATEST Adobe Employee , Oct 31, 2018

for those using androidX

com.android.support:design is now moved to com.google.android.material

you will need to include this

implementation 'com.google.android.material:material:1.1.0-alpha02' 

error: No resource identifier found for attribute 'TextView' in package , Articles KB47930: "No resource identifier found for attribute 'textAlignment' in package 'android'" Appears the Console when Building the  No resource identifier found for attribute 'srcCompat' in package 'learnapp.android.example.com.learnapp' 4 Error:(27) No resource identifier found for attribute 'srcCompat' in package 'com.example.jaisonjoseph.newsclient'

KB47930: "No resource identifier found for attribute 'textAlignment' in , Hi. I AM trying to add this line to the manifest editor: AndroidManifest.xml:19: error​: No resource identifier found for attribute  No resource identifier found for attribute 'cardCornerRadius' in package; No resource identifier found for attribute 'cardElevation' in package; No resource identifier found for attribute 'cardUseCompatPadding' in package ' I am using Visual studio 2015 with Xamarin Android SDK tools all installed 23.0.0 and Above & api above 14. nuGet

error: No resource identifier found for attribute, No resource identifier found for attribute 'style' in package 'android'. Getting the above error? Get ready to kick yourself. You don't need to specify the 'android'  android\app\build\intermediates\manifests\full\release\AndroidManifest.xml:63: AAPT: No resource identifier found for attribute 'appComponentFactory' in package 'android' FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':app:processReleaseResources'. Failed to process resources, see aapt output above for details.

No resource identifier found for attribute 'style' in package 'android , [ERROR] : myApp/build/android/res/layout/​intercom_blocks_container_quick_reply_layout.xml:2: error: No resource identifier found for attribute  No suggested jump to results; No resource identifier found for attribute 'alpha' in package error: No resource identifier found for attribute 'alpha' in

Comments
  • Please be sure that you are using the latest version of the design library. In order to get the latest version check the official page of the design library. developer.android.com/training/material/… As of writing this comment the latest version is compile 'com.android.support:design:25.3.1'
  • In app/build.gradle I put version 26.1.0 within "dependencies{compile 'com.android.support:design:26.1.0}" _ it works thanks! @kris larson!
  • In addition, app:layout_behavior="@string/appbar_scrolling_view_behavior" also works after adding the material library.
  • but how on earth would you know that com.android.support:design:23.1.0 is the solution to a broken app:layout_behavior = "@string/appbar_scrolling_view_behavior"
  • @dsdsdsdsd I just tried it out, as I was having the same problem at some point
  • my library already has this dependency still it shows same error. When I add design library to app project gradle dependency then it goes away. Why do i have to add it to app project when it's already there in library? any solution?
  • @Asu Not sure what's going on there, but also beware that the versions have changed by bow - so you should use the most recent design library version. You could check if you find some information regarding the behavior you mentioned here: developer.android.com/studio/build/dependencies.html
  • com.android.support:design is now moved to com.google.android.material
  • Even i was getting this error in "compileSdkVersion 29". So, I have added this line implementation 'com.google.android.material:material:1.0.0'. It resolved the error.
  • thx, Just Restart make it work in v3.4 , but several minutes later, it auto turned red
  • I have migrated to androidx packages (i.e. implementation 'com.google.android.material:material:1.0.0'), and am seeing this same thing. I invalidated caches and restarted, red error went away for just a few seconds, then came back.
  • @tfrysinger run your app its work and the red error always exists until next update :)
  • It only occurs in new Android Studio 3.4. Following the issue here issuetracker.google.com/issues/131403371
  • @kdblue you are correct. In Android Studio v3.4 , showing app:layout_behavior="@string/appbar_scrolling_view_behavior" Unresolved class @string/appbar_scrolling_view_behavior but work when you run your app.