1

I got a error message like this:

Gradle: No resource identifier found for attribute 'dividerColor' in package 'com.astuetz.viewpager.extensions.example'

When I'm trying to merge the source code from a library and example. Here is the folder structure of the source code:

enter image description here

Here are what I did:

  • Copy all the example code to com/astuetz/viewpager/extensions/example folder. The package is com.astuetz.viewpager.extensions.example.
  • Copy all the library source code into com/astuetz/viewpager/extensions/ because its package name is com.astuetz.viewpager.extensions.
  • Copy the res of example and library into res folder.

Here is the AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.astuetz.viewpager.extensions"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="4" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar" >
        <activity
            android:label="@string/app_name"
            android:name="com.astuetz.viewpager.extensions.example.MainActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:label="@string/app_name"
            android:name="com.astuetz.viewpager.extensions.example.PagerActivity" >
        </activity>
    </application>

</manifest>

Here is the res/values/attrs.xml which is from the library.

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <declare-styleable name="ViewPagerExtensions">

        <attr format="integer" name="fadeOutDelay" />
        <attr format="integer" name="fadeOutDuration" />
        <attr format="color" name="textColorSelected" />
        <attr format="color" name="lineColor" />
        <attr format="color" name="lineColorSelected" />
        <attr format="dimension" name="lineHeight" />
        <attr format="dimension" name="lineHeightSelected" />
        <attr format="color" name="dividerColor" />
        <attr format="dimension" name="dividerMarginTop" />
        <attr format="dimension" name="dividerMarginBottom" />
        <attr format="reference" name="dividerDrawable" />
        <attr format="dimension" name="outsideOffset" />

    </declare-styleable>

</resources>

But I always got the error message I mentioned above. This confused me because I set the package to com.astuetz.viewpager.extensions. Why it always look for res in com.astuetz.viewpager.extensions.example?

Can anybody advise? Thanks

Bagusflyer
  • 12,675
  • 21
  • 96
  • 179

0 Answers0