Status Update
Comments
ma...@gmail.com <ma...@gmail.com> #2
I also tried moving sharedElement to BoxWithConstraints (rather than in its content), but did not help.
So the layout hierarchy looks like this (with more details and with "..." I replaced series of "normal" layouts):
NavHost -> ... -> AnimatedVisibility -> ... -> BoxWithConstraints with sharedElement -> some content
\> ... -> AnimatedVisibility -> ... -> LazyList -> ... -> Animated Visibility -> Selection container -> BoxWithConstraints with sharedElement -> some content
Any ideas?
ma...@gmail.com <ma...@gmail.com> #3
In your BoxWithConstraints
do you do any conditional composition? Things like:
if (constraintsExceedsCertainThreshold) composeSomeContent() else someOtherContent()
br...@gmail.com <br...@gmail.com> #4
Also note `sharedElement` is put on `BoxWithContraints` now, not on the content.
Thanks!
br...@gmail.com <br...@gmail.com> #5
Based on the stacktrace, it seems like the item in question is composed but never placed. Do you use custom precompose
or prefetch logic in your lazy list?
jo...@google.com <jo...@google.com> #6
There is also one `AnimatedContent` above the `BoxWithConstraints`. Could this cause issues?
Thank you for looking into this.
jo...@google.com <jo...@google.com> #7
The AnimatedContent never skips measuring/placing children after it composes them. So I don't expect that to be the issue.
Since you mentioned the modifier is on BoxWithConstraints
rather than on the children of BoxWithConstraints
, my guess is it's most likely related to LazyList.
Can you clarify what type of LazyList you are using? Is it LazyColumn/Row or LazyGrid, or something else?
ex...@gmail.com <ex...@gmail.com> #8
It's a LazyColumn.
tg...@google.com <tg...@google.com> #9
One interesting observation is that this stack trace did not seem to come from the ComposeView
with our app's Activity
content. Because I did a release with copy pasted setContent
+ ComposeView
subclass that is catching exceptions in dispatchDraw
and it did not catch this crash. Is the animations framework doing content composition outside the app's composition context? One note: at the time I tried this exception catching, sharedElement
was applied to the content of BoxWithConstraints
(rather than to the BoxWithConstraints
itself), but I don't think this would have caused the exception catching not to work.
ma...@gmail.com <ma...@gmail.com> #10
Hey, sorry to insist - any more ideas here?
uc...@google.com <uc...@google.com>
jo...@google.com <jo...@google.com> #11
I'm investigating what would cause items to be composed but not placed.
We'll submit a fix in shared element in 1.8 to account for that scenario if that's an intended behavior.
Have you tried a recent 1.8 release and see if it's reproducible?
ma...@gmail.com <ma...@gmail.com> #12
Thank you!
Unfortunately we cannot release publicly with 1.8 alpha, and we never reproed this issue locally even with 1.7.x.
ma...@gmail.com <ma...@gmail.com> #13
I'll prepare a fix to account for the use case where content may be composed but never participate in either measurement or placement. Keep in mind, the fix likely will only land in 1.8.
an...@supercell.com <an...@supercell.com> #14
Awesome, thank you! If there's any chance to have it in 1.7.6, would be absolutely amazing, but no worries if not. Thanks a lot again for the help!
ex...@gmail.com <ex...@gmail.com> #15
Project: platform/frameworks/support
Branch: androidx-main
Author: Doris Liu <
Link:
Require shared element to draw in place before drawing in overlay
Expand for full commit details
Require shared element to draw in place before drawing in overlay
This change fixes a rare issue where a shared element is composed
in both incoming and outgoing content, but measured and placed in
neither. The fix involves checking the shared element has been
drawn for at least frame before drawing it in the overlay. This
accounts for not only the requirement to measure and place shared
elements, but also ensured that when the draw is skipped by
a parent, shared element will not draw.
Fixes: 371802474
Test: New test added
Change-Id: I35108ce255cf4728a9ca3ef7834d6962abcc94c0
Files:
- M
compose/animation/animation/src/androidInstrumentedTest/kotlin/androidx/compose/animation/SharedTransitionTest.kt
- M
compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/SharedContentNode.kt
- M
compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/SharedElement.kt
Hash: baae6769d3323d141b17e0d916323cf6487034ea
Date: Wed Nov 13 15:27:39 2024
jo...@google.com <jo...@google.com> #16
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.animation:animation:1.8.0-alpha07
androidx.compose.animation:animation-android:1.8.0-alpha07
androidx.compose.animation:animation-jvmstubs:1.8.0-alpha07
androidx.compose.animation:animation-linuxx64stubs:1.8.0-alpha07
ar...@google.com <ar...@google.com>
np...@gmail.com <np...@gmail.com> #17
In the app.iml file, it looks like Android Studio has added C:\ as a sources root. Manually changing that to C:\programs\projectName and restarting Android Studio causes the first round of indexing to complete quickly and behave normally for a few seconds, after which it overwrites the file almost immediately with the same C:\ sources root again, after which it enters the same indexing loop forever.
tg...@google.com <tg...@google.com> #18
np...@gmail.com <np...@gmail.com> #19
There are a couple absolute paths in there. I worried that might have been causing the "C:\" sources root, but even making them relative paths (and importing from scratch again) didn't fix it.
[Deleted User] <[Deleted User]> #20
Scanning files to index was taking hours, so I left it overnight. In the morning I find the Android Studio process had read 185.35 GB from the disk and is now asking for more RAM. It either tries to read my whole disk (which is about 400 GB), or reads the same data over and over again. I'm not going to give this thing more RAM to do more of what it does now.
I never imagined that it can get any worse than Android Studio 3.2, but 3.3 is plain unusable.
an...@supercell.com <an...@supercell.com> #21
But, I discovered that creating a disk image (MacOS with Diskutility), copied project there and opened. Now the scanning phase completed. Tested with two projects that got stuck when working under home direcotry. Both worked this way.
jo...@google.com <jo...@google.com> #22
I don't have a workaround for you but this happens in the case that ndk-build is used and a target builds sources from NDK's android_app_glue along with sources in project folder. In this case, Android Studio incorrectly finds the common ancestor folder, C:\. There may be other ways to hit the bug but that's what's happening in your case.
an...@supercell.com <an...@supercell.com> #23
java.lang.Throwable: The file '/' is not under content entry root '/Applications/Android Studio.app/Contents/bin'
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:126)
at com.intellij.openapi.roots.impl.ContentEntryImpl.assertFolderUnderMe(ContentEntryImpl.java:378)
at com.intellij.openapi.roots.impl.ContentEntryImpl.assertCanAddFolder(ContentEntryImpl.java:290)
at com.intellij.openapi.roots.impl.ContentEntryImpl.assertCanAddFolder(ContentEntryImpl.java:285)
at com.intellij.openapi.roots.impl.ContentEntryImpl.addSourceFolder(ContentEntryImpl.java:209)
at com.intellij.openapi.roots.impl.ContentEntryImpl.addSourceFolder(ContentEntryImpl.java:216)
at com.intellij.openapi.roots.impl.ContentEntryImpl.addSourceFolder(ContentEntryImpl.java:202)
at com.intellij.openapi.roots.impl.ContentEntryImpl.addSourceFolder(ContentEntryImpl.java:195)
at com.android.tools.ndk.GradleWorkspace.lambda$updateContentRoots$7(GradleWorkspace.java:399)
at com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel(ModuleRootModificationUtil.java:143)
at com.android.tools.ndk.GradleWorkspace.updateContentRoots(GradleWorkspace.java:374)
at com.android.tools.ndk.GradleWorkspace.lambda$null$0(GradleWorkspace.java:302)
at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.mergeRootsChangesDuring(ProjectRootManagerImpl.java:295)
at com.android.tools.ndk.GradleWorkspace.lambda$null$2(GradleWorkspace.java:301)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1038)
at com.android.tools.ndk.GradleWorkspace.lambda$updateGradleWorkspace$3(GradleWorkspace.java:297)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:447)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:431)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:415)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:817)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:758)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:394)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
74...@gmail.com <74...@gmail.com> #24
Somehow the home directory is being added as a source root:
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes" />
<output-test url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes" />
<exclude-output />
<content url="file://$USER_HOME$">
<sourceFolder url="file://$USER_HOME$" isTestSource="false" /> <------ Bad
....
Which forces the entire contents of the user's home directory to be scanned and indexed. We are using C++ libraries outside of the project's root - namely prebuilt Conan packages located in ~/.conan. Is there any workaround?
qu...@gmail.com <qu...@gmail.com> #25
But that makes that when the indexation "ends", it gets "stuck" (actually looks like is loading something, but never ends), in order to solve that I go to the Gradle pane and refresh the gradle project. When it is finally done, the indexing also ends and Android Studio allows me to build the project.
tg...@google.com <tg...@google.com>
jo...@google.com <jo...@google.com>
ma...@gmail.com <ma...@gmail.com> #26
ar...@google.com <ar...@google.com> #27
Can you provide more context around the scanning and indexing slowness you observed with 3.3.1 compared to 3.2.1?
Is it the same as
Thanks!
ro...@gmail.com <ro...@gmail.com> #28
When opening a project with a large amount of .h files (webrtc library), It takes around 10 mins in the indexing phase (long time but ok). The problem comes in the Building Symbols stage, it eats all the RAM avaiable and ends with a Low memory warning that makes the IDE unusable.
You can see in the attached screenshot where I configured the IDE to use 8Gb of RAM. If you increase the value it doesn't solve anything, it just does not stop consiming RAM until it hits the limit, no matter how high it is.
3.2 works ""ok"" (at least it doesn't freeze, but no code completion, syntax highlighting... )
Is there any workaround that could mitigate the issue?
ar...@google.com <ar...@google.com> #29
And if it's open source, where we can try to repro it ourselves, that would be even better.
[Deleted User] <[Deleted User]> #30
ro...@gmail.com <ro...@gmail.com> #31
Thanks for answering!
Our project has around 60.000 .h/.hpp files.
Unfortunately our project is not open source, however, our biggest dependency is webrtc which is.
I would say that if you create a project that depends on webrtc, you will see the same problem.
tg...@google.com <tg...@google.com> #32
Also, do you by any chance use Android Studio to open the generated gradle file in step
ho...@gmail.com <ho...@gmail.com> #33
ar...@gmail.com <ar...@gmail.com> #34
vi...@gmail.com <vi...@gmail.com> #35
Same behaviour. Same setup. OS X, c++
Found SO question that describes this as well on 4.1.
Description
There was also svn error, that said that my home folder was not in svn. Not sure if it tries to index my whole home folder now..
Everything works fast if I use experimental use active configuration only setting, but then I cant see my cpp files :(
Build: 3.3, AI-182.5107.16.33.5199772, 201812250239,
AI-182.5107.16.33.5199772, JRE 1.8.0_152-release-1248-b01x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.14.1 unknown, screens 2560x1440; Retina
Android Gradle Plugin: 3.3.0
Gradle: 4.10.2
NDK: from local.properties: 18.1.5063045; latest from SDK: 18.1.5063045;
LLDB: LLDB 3.1 (revision: 3.1.4508709)
CMake: from local.properties: (not specified); latest from SDK: 3.6.0-rc2; from PATH: (not found);
Source: user_sentiment_feedback
IMPORTANT: Please read