Android library project returns incorrect resources -
i'm having trouble resources in android library project. library project consists of it's source compiled in .class files in jars , resources in res
folder. classes compiled --non-constant-id
aapt option.
in library project have:
res/drawable/image1.png res/drawable/image3.png
in project dependent on library project have:
res/drawable/image2.png
eclipse creates r.txt , r.java each project. in total there's 2 r.txt's , 2 r.java's.
in library project's r.java, resource ids such:
image1=0x7f02007c; image3=0x7f02007d;
a library project means r.java file merged dependent project's r.java yielding final r.java looks like:
image1=0x7f02007c; image2=0x7f02007d; image3=0x7f02007e;
as expected, inclusion of image2
shifted memory locations down 1 in final r.java.
the problem: when reference resource, r.drawable.image3
, jars in library project, resolves id in non-merged r.java. example: r.drawable.image3 = 0x7f02007d
. 0x7f02007d
points image2
, thus, wrong resource returned. assume doing wrong. have ideas may be?
i solved problem. turned out jars in library project being built incorrectly (something specific build system). sorry comes across question while searching; won't helpful.
Comments
Post a Comment