Fixed
Status Update
Comments
on...@gmail.com <on...@gmail.com> #2
Any update?
xa...@google.com <xa...@google.com>
is...@google.com <is...@google.com>
ga...@google.com <ga...@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);
}
}
pa...@google.com <pa...@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)?
pa...@google.com <pa...@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?
pa...@google.com <pa...@google.com> #6
We encountered the same problem, please help to fix it asap.
al...@google.com <al...@google.com> #7
I just post a change for review: https://android-review.googlesource.com/#/c/47341/
in hope that someone can pay attention about this.
in hope that someone can pay attention about this.
am...@google.com <am...@google.com> #8
Apologies to the reporter who took time to contribute a fix. I've done a fix in a parallel that handle more cases. This just went in. I'm planning to release this ASAP.
https://android-review.googlesource.com/#/c/47570/
fl...@google.com <fl...@google.com> #9
Thanks! And I have verified the fix for ant task with our project. The fix looks good so far.
By the way, there is another issue pending your fix. It's about the parse for xxhdpi of AndroidManifest.xml. Maybe you have already fix it but not update that issuehttp://code.google.com/p/android/issues/detail?id=39622
By the way, there is another issue pending your fix. It's about the parse for xxhdpi of AndroidManifest.xml. Maybe you have already fix it but not update that issue
bo...@gmail.com <bo...@gmail.com> #10
I had been having the same issue for the last 2 weeks, and our project is at a halt because of this as well. Thanks a lot for the fix !
I'd appreciate it if someone can please tell me, when will this Fix be released? Will this be part of a SDK Revision 22?
Thanks
I'd appreciate it if someone can please tell me, when will this Fix be released? Will this be part of a SDK Revision 22?
Thanks
fl...@google.com <fl...@google.com> #11
So actually this is not completely fixed.
This works fine if there are 2+ libraries. If there is a single library and its package is the same as the app this will still fail. I'll fix this for 21.1. The other cases (more than one lib, some or all with the same packages) will go live with 21.0.1 which is due any time now.
This works fine if there are 2+ libraries. If there is a single library and its package is the same as the app this will still fail. I'll fix this for 21.1. The other cases (more than one lib, some or all with the same packages) will go live with 21.0.1 which is due any time now.
al...@gmail.com <al...@gmail.com> #12
21.0.1 fixes this issue partly and was release yesterday afternoon.
As noted above, if you have a single library that shares the app package name, and you build with Ant it will still fails. A workaround is to create a no-op empty 2nd library with the same package name. This will be fixed in the next release.
As noted above, if you have a single library that shares the app package name, and you build with Ant it will still fails. A workaround is to create a no-op empty 2nd library with the same package name. This will be fixed in the next release.
Description
Android Plugin Version: 4.0.0-alpha08
Module Compile Sdk Version: 29
Module Build Tools Version: <blank>
Android SDK Tools version: 29.0.2
I upgraded my project from AGP 4.0.0-alpha06 to 4.0.0-alpha08 and the assemble task started to report the following compilation error:
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class android.support.wearable.complications.ComplicationHelperActivity, unresolved supertypes: android.support.v4.app.ActivityCompat.OnRequestPermissionsResultCallback
The error appears also in 4.0.0-alpha07.
You can find an example project to reproduce the issue at