Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Build Fail Expo-Camera #27370

Closed
SamJbori opened this issue Feb 29, 2024 · 5 comments · Fixed by #27873
Closed

iOS Build Fail Expo-Camera #27370

SamJbori opened this issue Feb 29, 2024 · 5 comments · Fixed by #27873
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@SamJbori
Copy link

Minimal reproducible example

https://github.com/SamJbori/expo-camera-issue/

What platform(s) does this occur on?

iOS

Did you reproduce this issue in a development build?

Yes

Summary

Whenever I run expo run:ios I get the following error:

❌  (node_modules/expo-camera/ios/CameraView.swift:386:20)

  384 |         let deviceOrientation = ExpoCameraUtils.deviceOrientation(
  385 |           for: accelerometerData,
> 386 |           default: physicalOrientation)
      |                    ^ reference to property 'physicalOrientation' in closure requires explicit use of 'self' to make capture semantics explicit
  387 |         if deviceOrientation != self.physicalOrientation {
  388 |           self.physicalOrientation = deviceOrientation
  389 |           onResponsiveOrientationChanged(["orientation": deviceOrientation.rawValue])


❌  (node_modules/expo-camera/ios/CameraView.swift:389:11)

  387 |         if deviceOrientation != self.physicalOrientation {
  388 |           self.physicalOrientation = deviceOrientation
> 389 |           onResponsiveOrientationChanged(["orientation": deviceOrientation.rawValue])
      |           ^ reference to property 'onResponsiveOrientationChanged' in closure requires explicit use of 'self' to make capture semantics explicit
  390 |         }
  391 |       }
  392 |     } else {


❌  (node_modules/expo-camera/ios/Next/CameraViewNext.swift:282:20)

  280 |         let deviceOrientation = ExpoCameraUtils.deviceOrientation(
  281 |           for: accelerometerData,
> 282 |           default: physicalOrientation)
      |                    ^ reference to property 'physicalOrientation' in closure requires explicit use of 'self' to make capture semantics explicit
  283 |         if deviceOrientation != self.physicalOrientation {
  284 |           self.physicalOrientation = deviceOrientation
  285 |           onResponsiveOrientationChanged(["orientation": deviceOrientation.rawValue])


❌  (node_modules/expo-camera/ios/Next/CameraViewNext.swift:285:11)

  283 |         if deviceOrientation != self.physicalOrientation {
  284 |           self.physicalOrientation = deviceOrientation
> 285 |           onResponsiveOrientationChanged(["orientation": deviceOrientation.rawValue])
      |           ^ reference to property 'onResponsiveOrientationChanged' in closure requires explicit use of 'self' to make capture semantics explicit
  286 |         }
  287 |       }
  288 |     } else {

I fix it by adding self. where it says.

Environment

  expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 12.6.7
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 18.19.1 - ~/.nvm/versions/node/v18.19.1/bin/node
      Yarn: 1.22.21 - /usr/local/bin/yarn
      npm: 10.5.0 - ~/.nvm/versions/node/v18.19.1/bin/npm
      Watchman: 2024.01.22.00 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.12.1 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
      Android SDK:
        Android NDK: 22.1.7171670
    IDEs:
      Android Studio: 2023.1 AI-231.9392.1.2311.11330709
      Xcode: 14.2/14C18 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~50.0.8 => 50.0.8 
      react: 18.2.0 => 18.2.0 
      react-native: 0.73.4 => 0.73.4 
    npmGlobalPackages:
      eas-cli: 7.3.0
    Expo Workflow: bare

Expo Doctor Diagnostics

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for issues with metro config
✔ Check for common project setup issues
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!
@SamJbori SamJbori added the needs validation Issue needs to be validated label Feb 29, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels Feb 29, 2024
@alanjhughes
Copy link
Collaborator

Hi @SamJbori - I believe you need to upgrade your version of Xcode. We use 15.2 and this should not cause errors

@SamJbori
Copy link
Author

SamJbori commented Mar 1, 2024

Hi @SamJbori - I believe you need to upgrade your version of Xcode. We use 15.2 and this should not cause errors

Hey @alanjhughes, I guessed that but I have my reasons to use this version, I just raised the issue because it's an easy fix toward backward compatibility if it has no other impact

@AprilNEA
Copy link

Hi, when it will appear in the latest package, I desperately need to get this fix.

@SamJbori
Copy link
Author

SamJbori commented Apr 1, 2024

Hi, when it will appear in the latest package, I desperately need to get this fix.

It shouldn't be long time before it's released, however you can just do like me and modify the files manually. and them redo it every time you run yarn, pod install, etc..

@AprilNEA
Copy link

AprilNEA commented Apr 3, 2024

Every time modify thus files makes feel tired, I find some test version is working. Like 0.0.1-canary-20240328-24ecc5e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants