skiptools / skipapp-bookings

Demonstration of a full-featured Skip dual-platform app project for iOS and Android
11 stars 1 forks source link

2 back buttons appear on iPhone #1

Open malhal opened 5 months ago

malhal commented 5 months ago
  1. Launch on iPhone 15 Pro Simulator
  2. Scroll down so search appears, type in Dubai
  3. Select Dubai

Detail slides on with 2 back buttons (the native blue one and custom white one), see screenshot below:

Screenshot 2024-06-05 at 21 07 58

Xcode Version 15.4 (15F31d)

mh@Malcs-MBP MacOS % skip checkup
[✓] Skip version 0.8.46 (= 0.8.46)
[✓] macOS version 14.5 (> 13.5.0)
[✓] Swift version 5.10 (> 5.9.0)
[✓] Xcode version 15.4 (> 15.0.0)
[✓] Xcode tools SDKs: 8
[✓] Homebrew version 4.3.3 (> 4.1.0)
[✓] Gradle version 8.7 (> 8.6.0)
[✓] Java version 21.0.3 (> 21.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[!] Android Studio not found: brew install android-studio
[!] Android SDK licenses need to be accepted with: ~/Library/Android/sdk/tools/bin/sdkmanager --licenses
[✓] Resolve dependencies (11.28s)
[✓] Build hello-skip (8.78s)
[✓] Test Swift (5.15s)
[✗] Test Kotlin (61.4s)
[✓] Archive iOS ipa (17.51s)
[✓] Assemble HelloSkip-release.ipa 37 KB
[✓] Verify HelloSkip-release.ipa 37 KB
[✗] Assembling Android apk (25.67s)
[✗] Verify HelloSkip-release.apk: The file “app-release-unsigned.apk” couldn’t be opened because there is no such file.
[✓] Check Swift Package (0.31s)
[✗] Skip 0.8.46 checkup failed with 3 errors
Output logged to: /tmp/skip-checkup-2024-06-05T20:00:37Z.txt
See https://skip.tools/docs/faq and https://community.skip.tools for help and 2 warnings
Error: 4 errors
marcprux commented 5 months ago

Curious: that doesn't happen when I run it. We are setting .toolbar(.hidden, for: .navigationBar) in the CityView.swift, which should be hiding the button (and so using our custom back button).

Also, I notice your skip checkup failed. I assume you are not able to launch the Android version? If you want to post the output log (/tmp/skip-checkup-2024-06-05T20:00:37Z.txt), we can try to help you work through that issue as well.

Screenshot 2024-06-05 at 16 25 25
malhal commented 5 months ago

Sorry I should have mentioned I was still downloading Android Studio when I removed the gradle build phase to test the iPhone verison. Checkup passes now:

mh@Malcs-MBP MacOS % skip checkup
[✓] Skip version 0.8.46 (= 0.8.46)
[✓] macOS version 14.5 (> 13.5.0)
[✓] Swift version 5.10 (> 5.9.0)
[✓] Xcode version 15.4 (> 15.0.0)
[✓] Xcode tools SDKs: 8
[✓] Homebrew version 4.3.3 (> 4.1.0)
[✓] Gradle version 8.7 (> 8.6.0)
[✓] Java version 21.0.3 (> 21.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2023.3
[✓] Android tools SDKs: 2
[✓] Resolve dependencies (7.22s)
[✓] Build hello-skip (9.42s)
[✓] Test Swift (5.83s)
[✓] Test Kotlin (137.74s)
[✓] Archive iOS ipa (15.69s)
[✓] Assemble HelloSkip-release.ipa 37 KB
[✓] Verify HelloSkip-release.ipa 37 KB
[⠁] Verify HelloSkip-release.apk[✓] Assembling Android apk (118.27s)
[✓] Verify HelloSkip-release.apk 12.7 MB
[✓] Check Swift Package (0.41s)
[✓] Skip 0.8.46 checkup succeeded in 295.78s
malhal commented 5 months ago

Toolbar hidden also causes animation and layout glitches because it is hiding the bar on the first screen as well. navigationBarBackButtonHidden is another option but that disables the swipe back gesture. Seems there is no good solution for this in SwiftUI yet. It is interesting you don't experience the bug glitch though. Here is what it looks like just before I tap the row:

Screenshot 2024-06-06 at 09 38 04
marcprux commented 5 months ago

I hadn't been navigating from a filtered search result. When I do that (first filtering on "Dubai", then ), I do see the double back button you reported. Strangely, if you then navigate into one of the "Nearest Cities" (e.g., Cairo) and then back out of it, the default nav button is hidden and the UI looks correct.

This is clearly a SwiftUI bug. And while it isn't a bug in Skip per se (since the Android side works fine), we should try to figure out a workaround for this glitchy behavior. Please let us know if you have any suggestions.