Status Update
Comments
jh...@gmail.com <jh...@gmail.com>
jh...@gmail.com <jh...@gmail.com> #2
i donnot understand why is the data the same?
ch...@google.com <ch...@google.com>
na...@vitruvian.me <na...@vitruvian.me> #3
ri...@google.com <ri...@google.com> #4
What steps are needed to reproduce this issue? Frequency of occurrence?
Which Android build are you using? (e.g. AP4A.241205.013.A1)
Which device did you use to reproduce this issue?
Can you confirm if this issue is reproducible on a Pixel/Nexus device?
Please provide a sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Android bug report (to be captured after reproducing the issue)
For steps to capture a bug report, please refer:
Alternate method
Navigate to “Developer options”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Note: Please upload the bug report and screenshot to google drive and share the folder to android-bugreport@google.com, then share the link here.
ri...@google.com <ri...@google.com> #5
Please provide the requested information to proceed further. Unfortunately the issue will be closed within 7 days if there is no further update.
jh...@gmail.com <jh...@gmail.com> #6
for example,we hava 100 users.
20 users returned the same location information, longitude is 121.474000 and latitude is 31.230001。
30 users returned the same location information, longitude is 122.474000 and latitude is 32.230001。
15 users returned the same location information, longitude is 120.474000 and latitude is 30.230001。
as for Android build,all versions have it.
I dont reprodouce this issue.
what may be the cause of this issue?please
jh...@gmail.com <jh...@gmail.com> #7
We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
ri...@google.com <ri...@google.com> #8
Thanks for reporting this issue.
COARSE_LOCATION typically takes location information from the nearby cell tower. If many users are near the same cell tower, each of those users will be given the same position. Using a FINE position will give much more detailed information.
Also, in certain areas, for privacy reasons, a less-exact location will be given, and that less-exact location might be identical for many users. Again, a fine-location configuration will return more precise location data.
ri...@google.com <ri...@google.com> #9
We believe with reference to the above comment, your query has been answered, hence closing the bug. Please feel free to re-open the issue in the future if desired.
ri...@google.com <ri...@google.com> #10
ga...@google.com <ga...@google.com>
ga...@google.com <ga...@google.com> #11
This issue is caused by usage of stable IDs (automatically injected by the IDE as -Pandroid.injected.enableStableIds=true
), but the root cause is that 2 tasks are not configured in the same way:
LinkAndroidResForBundleTask
does not take the stable ids as input - produces proto output used by the resource shrinkerLinkApplicationAndroidResourcesTask
does take the stable ids as input - produces *.ap_ and resource IDs used by R8
This results in different IDs assigned by these 2 tasks (I was flip-flopping between string names aaaa
and zzzz
):
~/Android/Sdk/build-tools/33.0.2/aapt2 dump resources ~/Downloads/google_report/sample/app/main/build/intermediates/linked_res_for_bundle/profiling/bundled-res.ap_ | grep zzzzz
resource 0x7f0d0026 string/zzzzz
~/Android/Sdk/build-tools/33.0.2/aapt2 dump resources
~/Downloads/google_report/sample/app/main/build/intermediates/processed_res/profiling/out/resources-profiling.ap_ | grep zzzzz
resource 0x7f0d0027 string/zzzzz
It also means that 0x7f0d0026
is used as input for resource shrinking, but 0x7f0d0027
is used as resource id that gets inlined by R8 (as it is never modified).
Workaround
When using resource shrinking, build from the command line and use AGP to deploy the APK. Disabling android.injected.enableStableIds
in gradle.properties
is not possible at the moment as IDE-injected property wins.
Description
When certain build features are used together, the resource shrinker mangles resource IDs. Resource ID integers in the resulting binary are wrong, which at runtime leads either to
The behavior is not totally deterministic - some builds are fine, but sometimes, renaming the XML resource is enough (!) to get the crash. Sometimes, a clean build, AS restart, or invalidate caches & restart command fixes things, but only temporarily, until the next rename.
To reproduce, please run the attached project, distilled from a real-world project:
R.string.sample_string_resource
resource to anything else, and try again.android.content.res.Resources$NotFoundException: String resource ID #0x7f0d0027
(full stack trace below).The issue can be mitigated by not using certain build features. Each one of the following fixes the problem independently:
isShrinkResources = false
.resourceConfigurations += "en"
.settings.gradle.kts
andbuild.gradle.kts
).Notes:
Thanks, and let me know if I can help further. 🙏
Full stack trace:
System info: