6

Yesterday I upgraded XCode and my project to iOS 13.4 and I started to see a lot of failures in around views that use GeometryReaders.

The error does not reveal anything besides "precondition failure: invalid input index"

2
  • Suffered the same issue. Removing the parent NavigationView solved the issue in my case (I didn't need it), but this may not be a suitable solution for all. Commented Mar 27, 2020 at 0:12
  • Also seeing this. This update is killing me :( Commented Mar 30, 2020 at 15:25

2 Answers 2

4

I had the exact same issue after upgrading to 13.4.1.

I installed a simulator with 13.3.3 and it didn't have the issue.

What ended up causing the issue was having a GeometryReader as an inner view of a NavigationView. Making the GeometryReader the top-most view fixed it for me.

Sign up to request clarification or add additional context in comments.

1 Comment

This answer might be a nice temporary fix to get going again, but if this is indeed the issue this seems like a critical bug. Not being able to (consistently) use GeometryReader inside a NavigationView is a gamebreaker!
0

After debugging and starting to lose my mind, I found that each view that had a GeometryReader also was using onReceive with a call to a function that had Combine code.

Basically I was calling .collect() on the Publisher and sink-ing the result to a variable.

After I removed the Combine code and started to use old fashioned array operations, all started working again.

6 Comments

hi Andrei, the latest update has also broken my Watch app that uses SwiftUI. I use GeometryReader to read the size of the screen so I can draw a frame in a size relative to the screen size. So I using geometry.size.width and geometry.size.height, I get precondition failure: invalid input index: 2. I seem to think it relates to the height, but I'm not sure what is wrong.
Do you use Combine in any way? I also was suspecting geometry.size.height but after removing all the Combine code, it started working again
I'm seeing the exact same problem as @alamodey. Has anyone managed to reproduce this in a sample project? This doesn't seem like expected behaviour at all
I am seeing the same issue. Any solution ?
@alamodey my crash is only appearing in simulator. It runs fine on device, except (oddly) when running the app using the VoiceOver accessibility feature
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.