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

后端 未结 7 972
梦谈多话
梦谈多话 2020-11-29 20:10

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

xmlns:app="http://schemas.android.com/apk/res-auto"
相关标签:
7条回答
  • 2020-11-29 20:15

    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"

    0 讨论(0)
  • 2020-11-29 20:17

    this helps for me:

    on your build.gradle:

    implementation 'com.android.support:design:28.0.0'
    
    0 讨论(0)
  • 2020-11-29 20:28

    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

    0 讨论(0)
  • 2020-11-29 20:28

    This also happened to me when a PercentageRelativeLayout https://developer.android.com/reference/android/support/percent/PercentRelativeLayout.html was used and the build was targeting Android 0 = 26. PercentageRelativeLayout layout is obsolete starting from Android O and obviously sometime was changed in the resource generation. Replacing the layout with a ConstraintLayout or just a RelativeLayout solved it.

    0 讨论(0)
  • 2020-11-29 20:29

    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

    0 讨论(0)
  • 2020-11-29 20:32

    You can also use lib-auto

     xmlns:app="http://schemas.android.com/apk/lib-auto"
    
    0 讨论(0)
提交回复
热议问题