Fixed
Status Update
Comments
tn...@google.com <tn...@google.com> #3
Maybe I have located the problem. It's in the method com.android.ant.AaptExecTask.execute in the file com.android.ant.AaptExecTask.java.
So can I just use a fix as below (add a check for the package name) ?
@Override
public void execute() throws BuildException {
...
// execute it.
task.execute();
// now if the project has libraries, R needs to be created for each libraries
// but only if the project is not a library.
try {
if (!mNonConstantId && libPkgProp != null && !libPkgProp.isEmpty()) {
File rFile = new File(mBinFolder, SdkConstants.FN_RESOURCE_TEXT);
if (rFile.isFile()) {
SymbolLoader symbolValues = new SymbolLoader(rFile);
symbolValues.load();
// we have two props which contains list of items. Both items represent
// 2 data of a single property.
// Don't want to use guava's splitter because it doesn't provide a list of the
// result. but we know the list starts with a ; so strip it.
if (libPkgProp.startsWith(";")) {
libPkgProp = libPkgProp.substring(1).trim();
}
String[] packages = libPkgProp.split(";");
String[] rFiles = libRFileProp.list();
if (packages.length != rFiles.length) {
throw new BuildException(String.format(
"%1$s and %2$s must contain the same number of items.",
mLibraryPackagesRefid, mLibraryRFileRefid));
}
for (int i = 0 ; i < packages.length ; i++) {
File libRFile = new File(rFiles[i]);
if (libRFile.isFile()) {
SymbolLoader symbols = new SymbolLoader(libRFile);
symbols.load();
if (! "the packageName in the AndroidManifest.xml of the current project".equals(packages[i])) { // add a check here before the write so it will prevent the overwrite of the R.java generated at some point before it arrives here
SymbolWriter writer = new SymbolWriter(mRFolder, packages[i],
symbols, symbolValues);
writer.write();
}
}
}
}
}
} catch (IOException e) {
throw new BuildException(e);
}
}
tn...@google.com <tn...@google.com> #4
Hello! Any update?
Is it OK to make that fix? Or will you fix the bug in the next release (e.g. r22)?
Is it OK to make that fix? Or will you fix the bug in the next release (e.g. r22)?
tn...@google.com <tn...@google.com> #5
This has become a bottleneck for our project. Could you please update if there is any work around as chnaging package names is not feasible for us. When would the fix be available?
pv...@gmail.com <pv...@gmail.com> #6
We encountered the same problem, please help to fix it asap.
Description
1. Create a layout that refers to an attr style
<TextView xmlns:android="
android:id="@id/text1"
style="?android:attr/listSeparatorTextViewStyle" />
2. Run lint
RESULTS
Actual: Lint reports that layout_width and layout_height are missing.
Expected: Lint shouldn't report that layout_width and layout_height are missing, as these are provided by the style.
NOTES
Reproduced with Eclipse 4.2.1, ADT 21 preview 10, tools 21 preview 10