Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No resource identifier found for attribute '...' in package 'com.app....'

I've imported a project from Eclipse to Android studio. It utilizes a custom view:

xmlns:app="http://schemas.android.com/apk/res-auto"

I get errors in the lines below from activity_ro.xml file like:

"Error:(136) No resource identifier found for attribute 'pstsTabPaddingLeftRight' in package 'com.app.xxxx'"

app:pstsDividerColor="#00000000"
app:pstsIndicatorColor="#FF33B5E6"
app:pstsTabPaddingLeftRight="14dip"
app:pstsUnderlineColor="#FF33B5E6" />

I'm not sure if custom views are different for gradle or maybe I'm doing something wrong. Anyone have an idea?

like image 211
kevthanewversi Avatar asked Mar 03 '15 08:03

kevthanewversi


6 Answers

I just changed:

xmlns:app="http://schemas.android.com/apk/res-auto" 

to:

xmlns:app="http://schemas.android.com/apk/lib/com.app.chasebank"

and it stopped generating the errors, com.app.chasebank is the name of the package. It should work according to this Stack Overflow : No resource identifier found for attribute 'adSize' in package 'com.google.example' main.xml

like image 124
kevthanewversi Avatar answered Nov 17 '22 07:11

kevthanewversi


You can also use lib-auto

 xmlns:app="http://schemas.android.com/apk/lib-auto"
like image 45
Jose M Lechon Avatar answered Nov 17 '22 05:11

Jose M Lechon


I was facing the same problem and solved it using the below steps:

Add this in your app's build.gradle

android {
    defaultConfig {
        vectorDrawables.useSupportLibrary = true
    }
}

Use namespace:

xmlns:app="http://schemas.android.com/apk/res-auto"

Then use:

app:srcCompat="@drawable/your_vector_drawable_here"

like image 28
Saini Arun Avatar answered Nov 17 '22 06:11

Saini Arun


I've been searching answer but couldn't find but finally I could fix this by adding play-service-ads dependency let's try this

*) File -> Project Structure... -> Under the module you can find app and there is a option called dependencies and you can add com.google.android.gms:play-services-ads:x.x.x dependency to your project

I faced this problem when I try to import eclipse project into android studio

Click here to see screenshot

like image 2
HashanR Avatar answered Nov 17 '22 07:11

HashanR


I solved is by using android:background instead of app:srcCompact.

This is caused by xmlns:app="http://schemas.android.com/apk/res-auto". As people have suggested above, you could use /lib-auto or /lib/your-package but I got suspicious namespace error when I tried using /lib-auto and unexpected namespace prefix error with /lib/my-package .

like image 1
Raza Avatar answered Nov 17 '22 05:11

Raza


this helps for me:

on your build.gradle:

implementation 'com.android.support:design:28.0.0'
like image 1
Acauã Pitta Avatar answered Nov 17 '22 07:11

Acauã Pitta