无法自动选择Xcode项目

时间:2023-01-13 20:32:02

When i type "pod install" in a correct directory I always get this

当我在正确的目录中键入“pod install”时,我总是得到这个

Analyzing dependencies

[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:

    project 'path/to/Project.xcodeproj'

podfile

platform :ios, '8.0'
use_frameworks!

target 'Posting' do
pod 'ALCameraViewController'

end

I'm in the project directory where Podfile can be found.

我在可以找到Podfile的项目目录中。

13 个解决方案

#1


21  

I had an old .xcodeproj-file in my folder, so there was 2 of them. I removed the old one and it works!

我的文件夹中有一个旧的.xcodeproj文件,所以有2个。我删除了旧的,它的工作原理!

#2


7  

This happened to me, I had my "podfile" in the subfolder and not the main directory, e.g., ~/MyProject/MyProject/podfile instead of ~/Myproject/podfile

这发生在我身上,我在子文件夹中有“podfile”而不是主目录,例如〜/ MyProject / MyProject / podfile而不是〜/ Myproject / podfile

Hope this helps!

希望这可以帮助!

#3


7  

Add your Podfile to project line for Specify project path

将Podfile添加到指定项目路径的项目行

target 'MyGPSApp' do
  project 'FastGPS'
  ...
end

details: https://guides.cocoapods.org/syntax/podfile.html#project

#4


5  

platform :iOS, '8.0'
use_frameworks!

target 'Posting' do
project 'projectpath/project.xcodeproj'
pod 'ALCameraViewController'
end

#5


1  

I had this issue when I accidentally deleted '.xcodeproj' file.

当我意外删除'.xcodeproj'文件时,我遇到了这个问题。

#6


0  

Did you include the entire ALCameraViewController repository in your project folder? I did that initially, and I got the same error. Go back to the repo and follow the README.md file step by step.

您是否在项目文件夹中包含了整个ALCameraViewController存储库?我最初这样做了,我得到了同样的错误。返回到repo并逐步遵循README.md文件。

If you did include the entire repo, I would also advise to remove all the folders that you included in your project that came from the ALCameraViewController repo. Then try to install the repo in the Podfile again, the error should be gone.

如果您确实包含了整个仓库,我还建议您删除项目中包含的所有文件夹,这些文件夹来自ALCameraViewController仓库。然后尝试再次在Podfile中安装repo,错误应该消失。

#7


0  

I had the Same problem , i solved it by moving the podfile to the main project folder , in your case : 1- move the pod file to 'Posting' folder , in which there are 'Posting' subfolder and 'Posting.xcodeproj' file
2- re run the ' pod install ' command. 3- enjoy

我有同样的问题,我通过将podfile移动到主项目文件夹解决了它,在你的情况下:1-移动pod文件到'Posting'文件夹,其中有'Posting'子文件夹和'Posting.xcodeproj'文件2-重新运行'pod install'命令。 3-享受

#8


0  

I had the same issue, the problem was in that my project folder was synchronized with iCloud and .xcodeproj wasn't fully loaded from it. It was visible in Finder but not visible in Terminal. The solution was to open/close .xcodeproj and try "pod install" again

我遇到了同样的问题,问题在于我的项目文件夹与iCloud同步,并且.xcodeproj没有从它完全加载。它在Finder中可见但在终端中不可见。解决方案是打开/关闭.xcodeproj并再次尝试“pod install”

#9


0  

I had 2 files with .xcodeproj along with 1 .xcworkspace, inside my project folder. I deleted one and problem got resolved.

我的项目文件夹中有2个带.xcodeproj的文件和1个.xcworkspace。我删除了一个,问题得到解决。

In my case, I removed the one whose size was zero bytes.

就我而言,我删除了大小为零字节的那个。

#10


0  

I had a conflict because we were working in a team and I had a manifest.lock file under my pods directory that I had to remove and then run the pod install command and it worked :)

我有一个冲突,因为我们在一个团队工作,我在我的pods目录下有一个manifest.lock文件,我必须删除然后运行pod install命令,它工作:)

#11


0  

This happened to me too. We use git. And often change branches. While I changing a branch, some bug in Xcode made the project file lose its name. I did clean and changed branches or pull again. The Xcode project file was restored. But the old file with the missing name was still in there. This is not detected by git, if you try to do a pod update with this file in there, It will file. Delete this file or make sure you have only xcode proj file. This should fix it

这也发生在我身上。我们用git。并经常改变分支。当我更改分支时,Xcode中的一些错误导致项目文件失去了名称。我做了清洁和更换树枝或再拉。 Xcode项目文件已恢复。但是缺少名字的旧文件仍在那里。 git没有检测到这种情况,如果你尝试在那里用这个文件进行pod更新,它会提交文件。删除此文件或确保您只有xcode proj文件。这应该解决它

#12


0  

I have got this error when I have moved my repo to an external drive.

我将repo移动到外部驱动器时出现此错误。

#13


-1  

As shown in the image, Please Make sure the Podfile is in root folder not in subfolder.

如图所示,请确保Podfile不在子文件夹中的根文件夹中。

无法自动选择Xcode项目

#1


21  

I had an old .xcodeproj-file in my folder, so there was 2 of them. I removed the old one and it works!

我的文件夹中有一个旧的.xcodeproj文件,所以有2个。我删除了旧的,它的工作原理!

#2


7  

This happened to me, I had my "podfile" in the subfolder and not the main directory, e.g., ~/MyProject/MyProject/podfile instead of ~/Myproject/podfile

这发生在我身上,我在子文件夹中有“podfile”而不是主目录,例如〜/ MyProject / MyProject / podfile而不是〜/ Myproject / podfile

Hope this helps!

希望这可以帮助!

#3


7  

Add your Podfile to project line for Specify project path

将Podfile添加到指定项目路径的项目行

target 'MyGPSApp' do
  project 'FastGPS'
  ...
end

details: https://guides.cocoapods.org/syntax/podfile.html#project

#4


5  

platform :iOS, '8.0'
use_frameworks!

target 'Posting' do
project 'projectpath/project.xcodeproj'
pod 'ALCameraViewController'
end

#5


1  

I had this issue when I accidentally deleted '.xcodeproj' file.

当我意外删除'.xcodeproj'文件时,我遇到了这个问题。

#6


0  

Did you include the entire ALCameraViewController repository in your project folder? I did that initially, and I got the same error. Go back to the repo and follow the README.md file step by step.

您是否在项目文件夹中包含了整个ALCameraViewController存储库?我最初这样做了,我得到了同样的错误。返回到repo并逐步遵循README.md文件。

If you did include the entire repo, I would also advise to remove all the folders that you included in your project that came from the ALCameraViewController repo. Then try to install the repo in the Podfile again, the error should be gone.

如果您确实包含了整个仓库,我还建议您删除项目中包含的所有文件夹,这些文件夹来自ALCameraViewController仓库。然后尝试再次在Podfile中安装repo,错误应该消失。

#7


0  

I had the Same problem , i solved it by moving the podfile to the main project folder , in your case : 1- move the pod file to 'Posting' folder , in which there are 'Posting' subfolder and 'Posting.xcodeproj' file
2- re run the ' pod install ' command. 3- enjoy

我有同样的问题,我通过将podfile移动到主项目文件夹解决了它,在你的情况下:1-移动pod文件到'Posting'文件夹,其中有'Posting'子文件夹和'Posting.xcodeproj'文件2-重新运行'pod install'命令。 3-享受

#8


0  

I had the same issue, the problem was in that my project folder was synchronized with iCloud and .xcodeproj wasn't fully loaded from it. It was visible in Finder but not visible in Terminal. The solution was to open/close .xcodeproj and try "pod install" again

我遇到了同样的问题,问题在于我的项目文件夹与iCloud同步,并且.xcodeproj没有从它完全加载。它在Finder中可见但在终端中不可见。解决方案是打开/关闭.xcodeproj并再次尝试“pod install”

#9


0  

I had 2 files with .xcodeproj along with 1 .xcworkspace, inside my project folder. I deleted one and problem got resolved.

我的项目文件夹中有2个带.xcodeproj的文件和1个.xcworkspace。我删除了一个,问题得到解决。

In my case, I removed the one whose size was zero bytes.

就我而言,我删除了大小为零字节的那个。

#10


0  

I had a conflict because we were working in a team and I had a manifest.lock file under my pods directory that I had to remove and then run the pod install command and it worked :)

我有一个冲突,因为我们在一个团队工作,我在我的pods目录下有一个manifest.lock文件,我必须删除然后运行pod install命令,它工作:)

#11


0  

This happened to me too. We use git. And often change branches. While I changing a branch, some bug in Xcode made the project file lose its name. I did clean and changed branches or pull again. The Xcode project file was restored. But the old file with the missing name was still in there. This is not detected by git, if you try to do a pod update with this file in there, It will file. Delete this file or make sure you have only xcode proj file. This should fix it

这也发生在我身上。我们用git。并经常改变分支。当我更改分支时,Xcode中的一些错误导致项目文件失去了名称。我做了清洁和更换树枝或再拉。 Xcode项目文件已恢复。但是缺少名字的旧文件仍在那里。 git没有检测到这种情况,如果你尝试在那里用这个文件进行pod更新,它会提交文件。删除此文件或确保您只有xcode proj文件。这应该解决它

#12


0  

I have got this error when I have moved my repo to an external drive.

我将repo移动到外部驱动器时出现此错误。

#13


-1  

As shown in the image, Please Make sure the Podfile is in root folder not in subfolder.

如图所示,请确保Podfile不在子文件夹中的根文件夹中。

无法自动选择Xcode项目