Status Update
Comments
mm...@google.com <mm...@google.com>
mk...@google.com <mk...@google.com> #2
Fix (pending) is I2c2dc7b600603ee430fd0d91b23d52ea8aa29ca9.
ga...@google.com <ga...@google.com> #3
tl...@gmail.com <tl...@gmail.com> #4
#sdkmanager --package_file=${PATH_WORKSPACE}/packages
while read p; do echo "y" | sdkmanager "${p}"; done <${PATH_WORKSPACE}/packages
ga...@google.com <ga...@google.com> #5
tl...@gmail.com <tl...@gmail.com> #6
tl...@gmail.com <tl...@gmail.com> #7
ga...@google.com <ga...@google.com> #8
tl...@gmail.com <tl...@gmail.com> #9
tl...@gmail.com <tl...@gmail.com> #10
```
(15:58:11) C02W513SHTD8:files aso$ /opt/android-sdk-macosx/tools/bin/sdkmanager --version
26.1.1
(15:58:17) C02W513SHTD8:files aso$ /opt/android-sdk-macosx/tools/bin/sdkmanager --install --package_file=package_file
Warning: Unknown argument --package_file=package_file
```
tl...@gmail.com <tl...@gmail.com> #11
ga...@google.com <ga...@google.com> #12
ze...@google.com <ze...@google.com> #13
tl...@gmail.com <tl...@gmail.com> #14
ga...@google.com <ga...@google.com>
bi...@google.com <bi...@google.com>
bi...@google.com <bi...@google.com> #15
je...@google.com <je...@google.com> #16
Has anyone re-tried it?
We switched back to RUN sdkmanager --package_file=$ANDROID_HOME/packages.txt
in our Dockerfile back in March of 2021.
ga...@google.com <ga...@google.com> #17
For what it's worth, I did a quick test with the latest CLI: 11076708 (
./sdkmanager --sdk_root="../sdk" --package_file=deps.txt
Deps.txt:
platform-tools
extras;google;instantapps
build-tools;35.0.0-rc3
So perhaps this is now resolved? I haven't tried it with more packages
bi...@google.com <bi...@google.com> #18
In debug build our obfuscation
and optimization
are disabled. Tree-shaking
is still enabled as it is not affected by this CompilationMode
.
So in order to test obfuscation, we need to use release build.
bi...@google.com <bi...@google.com> #19
A question to Ian, I find the class file output by r8 is not being obfuscated. I guess that is not expected, right? The configuration for r8 looks correct to me. I remember there is a way to share all the details of a r8 invocation right? zerny@
ze...@google.com <ze...@google.com> #20
Regarding debug build, it does indeed disable obfuscation and optimization as both break stack-traces / stepping behavior. Tree shaking is still enabled without explicitly disabling it.
You can generate a BaseCompilerCommand.Builder.dumpInputToFile
method on the builder, but it is not a public API so you may need to use a non-lib version of R8 to access it).
bi...@google.com <bi...@google.com> #21
I think we should remove this from 8.1 beta blocking release list and probably address it in early canary because 1) it is not a regression, 2) the fix would potentially break some users because they need to add additional keep rules for a library module to make sure the consumer(app or another library) module are able to get those classes from the library module.
je...@google.com <je...@google.com> #22
this should be fixed in one of the canary, so blocking beta only.
bi...@google.com <bi...@google.com> #23
Some updates regarding this issue:
As we want to make consuming a library as project dependency consistent with consuming the same library that has been published to maven, we need to add the local file dependencies when doing the inter-project publishing for library modules.
This becomes a problem because from the consumer side, we also include file dependencies of library modules. It is part of the ArtifactScope.FILE
The challenge is how to exclude transitive file dependencies from library modules.
Option 1. Do not add this to runtimeElements when publishing -> don't seen to work, see
Option 2. Compute transitive file dependencies in the application by subtracting computeLocalFileDependencies
-> it works for some cases but not sure it can work for all because computeLocalFileDependencies
doesn't support attributes
Option 3. Publish file dependencies from library and use FilterSpec
to exclude it in application, similar to packagedDependenciesClasspath
-> I feel this might be a proper fix
bi...@google.com <bi...@google.com> #24
Talked with Jerome, the consensus is to remove this from blocking list. The next step is to see if there is a simpler way to support this use case. (e.g. using included build and publish the library to local maven)
ga...@google.com <ga...@google.com> #25
It does make sense to add support for the common use-case (library projects without local file dependencies) and to have a reasonable fallback for the other case (library projects with local file dependencies).
xa...@google.com <xa...@google.com> #26
Stumbled upon this while looking at the list of 8.3 Beta bugs
As an additional note, library apiElements should contain non-minified classes as we'd expect external API surface of the library to be the same before and after minification. This is already the case, and no work is required here.
Is that really always the case? if you publish an AAR with obfuscation, you really want the API jar (<AAR>/api.jar
) to contains the obfuscated code. I would think that the inter-project publication should be the same.
ga...@google.com <ga...@google.com> #27
I agree that ideally we'd also compile against obfuscated classes. However, I'm concerned about blocking the compilation of downstream modules on R8.
Also, there is probably a debug
variant of the consumer that will see non-obfuscated classes on the compile classpath. The IDE is also not helping as it does not know about obfuscation. So even if we do push for compile classpath to block on R8 and have obfuscated classes, users may still hit issues.
Proper seems to be introduction of api
component that allows developers to specify the library API and consumers would compile only against sources in that component.
xa...@google.com <xa...@google.com> #28
That makes sense for inter-project dependencies where the edit-build-deploy cycle would be impacted. I agree the api
component would really be useful here.
bi...@google.com <bi...@google.com> #29
Here is the doc I shared with Gradle about this issue
jedo@, can you evaluate this ticket again? (this one seems to caused quite a lot efforts but the impact is limited, not sure what is the best way moving forward)
je...@google.com <je...@google.com> #30
bi...@google.com <bi...@google.com> #32
Soren, that is exactly this bug is about.
xa...@google.com <xa...@google.com> #33
Moving this to P1. We really need to fix this.
pa...@unissey.com <pa...@unissey.com> #34
I'm the person who asked the question Soren referenced in Stack Overflow. I'm taking note that this is a known bug that's gonna get fixed later on, and I'm glad to read that.
In the meantime, I found a workaround that I've described in my answer on SO:
bi...@google.com <bi...@google.com> #35
Fixed with I5b773131437720291fe02a2897d4171596e33acd
lo...@gmail.com <lo...@gmail.com> #36
Cool! Thank you!
Is that an AS or an AGP fix? Which version(s) will first get it?
bi...@google.com <bi...@google.com> #37
It is AGP fix and you should be able to get it in AGP 8.4-alpha05
an...@google.com <an...@google.com> #38
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Jellyfish | 2023.3.1 Canary 4
- Android Gradle Plugin 8.4.0-alpha04
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
lo...@gmail.com <lo...@gmail.com> #39
@
ni...@gmail.com <ni...@gmail.com> #40
ni...@gmail.com <ni...@gmail.com> #41
bi...@google.com <bi...@google.com> #42
Yeah, feel free to try it out in 8.4.0-alpha04
pa...@unissey.com <pa...@unissey.com> #43
I've just installed the release version of AGP 8.4.0 and can confirm that it resolves the issue. I can safely remove my workaround now, thank you.
bi...@google.com <bi...@google.com> #44
Glad to know that it works out! Thanks for confirming.
Description
Consumer ProGuard files should be handled better when a library module is used as a dependency in a multi-module project.
For example
my-app/build.gradle
contains the following dependency:implementation project(':my-library')
One of the following should happen.
Currently a hack workaround needs to be added to the consuming module in order to remove the consumer ProGaurd files.