Commit db41d3c
committed
fix: prevent Android "Cannot locate windowRecomposer" crash when measured before window attach
Under the React Native new architecture (Fabric), SurfaceMountingManager measures
a screen's views before they attach to the window, so the wrapped Compose
`ComposeView` throws "Cannot locate windowRecomposer" during `onMeasure`. Guard
`onMeasure` on the host `FrameLayout` to skip child measurement while detached,
and force a measure/layout pass once attached (`onAttachedToWindow` / `onLayout`
/ `requestLayout`) so the animation still composes and renders.
Fixes #33.1 parent 815eed8 commit db41d3c
2 files changed
Lines changed: 64 additions & 0 deletions
File tree
- .changeset
- android/src/main/java/com/dotlottiereactnative
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
44 | 57 | | |
45 | 58 | | |
46 | 59 | | |
| |||
414 | 427 | | |
415 | 428 | | |
416 | 429 | | |
| 430 | + | |
| 431 | + | |
417 | 432 | | |
418 | 433 | | |
419 | 434 | | |
420 | 435 | | |
421 | 436 | | |
| 437 | + | |
422 | 438 | | |
423 | 439 | | |
424 | 440 | | |
425 | 441 | | |
426 | 442 | | |
427 | 443 | | |
428 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
429 | 486 | | |
430 | 487 | | |
431 | 488 | | |
| |||
0 commit comments