Note that there are some explanatory texts on larger screens.

plurals
  1. PORelationship between res and package in Android studio
    primarykey
    data
    text
    <p>I got a error message like this: </p> <blockquote> <p>Gradle: No resource identifier found for attribute 'dividerColor' in package 'com.astuetz.viewpager.extensions.example'</p> </blockquote> <p>When I'm trying to merge the source code from a library and example. Here is the folder structure of the source code:</p> <p><img src="https://i.stack.imgur.com/3Rkji.png" alt="enter image description here"></p> <p>Here are what I did:</p> <ul> <li>Copy all the example code to com/astuetz/viewpager/extensions/example folder. The package is com.astuetz.viewpager.extensions.example.</li> <li>Copy all the library source code into com/astuetz/viewpager/extensions/ because its package name is com.astuetz.viewpager.extensions.</li> <li>Copy the res of example and library into res folder.</li> </ul> <p>Here is the AndroidManifest.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.astuetz.viewpager.extensions" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="4" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar" &gt; &lt;activity android:label="@string/app_name" android:name="com.astuetz.viewpager.extensions.example.MainActivity" &gt; &lt;intent-filter &gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:label="@string/app_name" android:name="com.astuetz.viewpager.extensions.example.PagerActivity" &gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>Here is the res/values/attrs.xml which is from the library.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;declare-styleable name="ViewPagerExtensions"&gt; &lt;attr format="integer" name="fadeOutDelay" /&gt; &lt;attr format="integer" name="fadeOutDuration" /&gt; &lt;attr format="color" name="textColorSelected" /&gt; &lt;attr format="color" name="lineColor" /&gt; &lt;attr format="color" name="lineColorSelected" /&gt; &lt;attr format="dimension" name="lineHeight" /&gt; &lt;attr format="dimension" name="lineHeightSelected" /&gt; &lt;attr format="color" name="dividerColor" /&gt; &lt;attr format="dimension" name="dividerMarginTop" /&gt; &lt;attr format="dimension" name="dividerMarginBottom" /&gt; &lt;attr format="reference" name="dividerDrawable" /&gt; &lt;attr format="dimension" name="outsideOffset" /&gt; &lt;/declare-styleable&gt; &lt;/resources&gt; </code></pre> <p>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?</p> <p>Can anybody advise? Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload