OK, so I have a module called “gridbox” which is a layout widget I wrote a very long time ago.
Within gridbox is the file res/values/gridboxAttrs.xml
which contains (abridged):
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="Gridbox_Layout">
<attr name="layout_weightx" format="float" />
<attr name="layout_weighty" format="float" />
</declare-styleable>
</resources>
In my application module I have res/values/styles.xml
which references resources defined above:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Style for a normal button -->
<style name="baseButton">
<item name="android:gravity">center</item>
<item name="layout_weightx">1</item>
<item name="layout_weighty">1</item>
<item name="android:layout_margin">1dip</item>
</style>
</resources>
This built just fine under Eclipse, but Android Studio gives me
ERROR: /Users/falk/MyProject/MyApp/build/intermediates/packaged_res/debug/packageDebugResources/values/values.xml:372:5-384:11: AAPT: error: style attribute 'attr/layout_weightx (aka org.efalk.myapp.test:attr/layout_weightx)' not found.
I’m guessing I need to do something to get Android Studio to know that the module “MyApp” depends on module “Gridbox”. My MyApp/build.gradle
file does end with
dependencies {
implementation project(':Gridbox')
}
I have no idea what else I should be doing.