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

Support for VisionOS #11961

Closed
5 tasks done
gabrieldonadel opened this issue Jun 22, 2023 · 16 comments · Fixed by #11965
Closed
5 tasks done

Support for VisionOS #11961

gabrieldonadel opened this issue Jun 22, 2023 · 16 comments · Fixed by #11965
Milestone

Comments

@gabrieldonadel
Copy link
Contributor

gabrieldonadel commented Jun 22, 2023

PRs

Report

What did you do?

  • Run pod init inside a visionOS project

  • Edit the Podfile to set visionOS as the selected platform

platform :visionos, '1.0'
  • Run pod install

What did you expect to happen?

CocoaPods show work just as in any other project

What happened instead?

Invalid Podfile file: Unsupported platform visionos
image

CocoaPods Environment

Stack

   CocoaPods : 1.12.1
        Ruby : ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
    RubyGems : 3.4.10
        Host : macOS 13.4 (22F66)
       Xcode : 15.0 (15A5161b)
         Git : git version 2.39.2 (Apple Git-144)
Ruby lib dir : /opt/homebrew/Cellar/ruby/3.2.2/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /opt/homebrew/Cellar/cocoapods/1.12.1/libexec/bin/pod

Plugins

cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0

Podfile

# Uncomment the next line to define a global platform for your project
platform :visionos, '1.0'

target 'react-native-visionOS' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for react-native-visionOS

  target 'react-native-visionOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end
@dnkoutso dnkoutso added this to the 1.13.0 milestone Jun 22, 2023
@gabrieldonadel
Copy link
Contributor Author

You may want to use xros also. Some internal code refer to visionOS as xros
image

@renchap
Copy link

renchap commented Jun 22, 2023

xros was the internal name during development, and not everything was renamed to visionos before the WWDC. VisionOS should be the named used everywhere now.

@marcpalmer
Copy link

My understanding is that in code terms it is staying as xros. e.g. TARGET_OS_XROS is, as advised by Apple engineers, the way to detect XROS at build time in ObjC code, and you must check this as well as TARGET_OS_IOS in some situations as the TARGET_OS_IOS is also true for XROS. I don't think all these are changing to VisionOS. They certainly haven't so far.

@Brett-Best
Copy link

@gabrieldonadel
Copy link
Contributor Author

I believe all the necessary PRs have been opened, please let me know if anything else is necessary

@dnkoutso
Copy link
Contributor

Nice thanks! Will take a look.

@gabrieldonadel
Copy link
Contributor Author

Hi @dnkoutso, quick question, do you already have an idea of when you're going to release CocoaPods 1.13.0? I'm not really sure how often the release process happens

@dnkoutso
Copy link
Contributor

dnkoutso commented Jul 5, 2023

@gabrieldonadel it happens kinda ad hoc with the free time of folks. No actual date. I do wish to land the SPM PRs that are open to add support for SPM dependencies into cocoapods.

It would be a good feature along side visionOS for a release as well as unblock Swift Macros (via SPM) for CocoaPods.

@dnkoutso
Copy link
Contributor

dnkoutso commented Jul 5, 2023

In the meantime you can use https://bundler.io/ to point to master of CocoaPods/CocoaPods and CocoaPods/Core to use this.

@abbana
Copy link

abbana commented Jul 6, 2023

Thanks,
can you please give the procedure or at least a bit of more detail on how to point master of CocoaPods/CocoaPods and CocoaPods/Core with bundler?

Will be highly appreciated.

@abbana
Copy link

abbana commented Jul 10, 2023

For those who wonder how do that, hope the below will help:

After scraping from
https://bundler.io/guides/git.html
https://medium.com/@soxjke/bundler-is-a-best-friend-of-ios-developer-2fc80d9ee85f
https://stackoverflow.com/questions/71299074/in-a-rails-gemfile-how-do-i-reference-a-commit-from-a-pr
https://github.com/CocoaPods/Core/blob/master/Gemfile.lockhttps://github.com/CocoaPods/Core/commit/9320bf557741d7ae80eda4415bc6fb2b0b3a8b9c

0 - gem install bundler
1- Go to the root of the project , where the Podfile is located
2- Create Gemfile and put the below

frozen_string_literal: true

gem 'cocoapods', git: 'https://github.com/CocoaPods/CocoaPods', ref: '400f290cb9269ea342948f629525a5542933627f'
gem 'cocoapods-core', git: 'https://github.com/CocoaPods/Core', ref: '9320bf557741d7ae80eda4415bc6fb2b0b3a8b9c'

3- execute bundle install
4- from now on use bundle exec pod install instead of pod install to install the pods

Bonus: use platform :visionos, '1.0' in Podfile , no upeercases

@mojavad
Copy link

mojavad commented Aug 4, 2023

Has this been released into Cocoapods? Still not recognising visionos after an update to my Cocoapods.

@futuretap
Copy link

futuretap commented Aug 7, 2023

How is this supposed to work for a target supporting both iOS and visionOS? The platform parameter only accepts one OS and specifying two platform lines fails with "The target xyz already has a platform set".

@gabrieldonadel
Copy link
Contributor Author

How is this supposed to work for a target supporting both iOS and visionOS? The platform parameter only accepts one OS and specifying two platform lines fails with "The target xyz already has a platform set".

You can just create a different target for each platform

@futuretap
Copy link

Hm, but my main app target supports both iOS and visionOS. (Specifically, SUPPORTED_PLATFORMS is iphoneos iphonesimulator xros xrsimulator.) When I specify MainApp_iOS and MainApp_visionOS as targets in the Podfile, how can it integrate those into my MainApp?

@Saadnajmi
Copy link

Saadnajmi commented Sep 15, 2023

@gabrieldonadel it happens kinda ad hoc with the free time of folks. No actual date. I do wish to land the SPM PRs that are open to add support for SPM dependencies into cocoapods.

It would be a good feature along side visionOS for a release as well as unblock Swift Macros (via SPM) for CocoaPods.

@dnkoutso Would it be possible to have a release with visionOS support sooner? That would make it easier for libraries to officially support visionOS rather than maintain a branch that targets cocoapods' master branch. I understand it's based on the free time of maintainers, I just wanted to express my desire for visionOS support sooner.

Also, thank you to the CocoaPods team for continuing to maintain! I'm excited about SPM support in the future :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants