easycode

[Flutter] Pod install 관련 오류 : Error running pod install, Unable to find a target named RunnerTests in project "Runner.xcodeproj', did find 'Runner' (+ No 'Podfile' found in the project directory) 본문

오류

[Flutter] Pod install 관련 오류 : Error running pod install, Unable to find a target named RunnerTests in project "Runner.xcodeproj', did find 'Runner' (+ No 'Podfile' found in the project directory)

ez() 2023. 8. 5. 00:23

xCode까지 설정 완료 후, flutter run을 실행했는데...!!

 

 

 

1. Error running pod install 오류

해당 오류가 발생했다. (이젠 오히려 좋아 블로그 포스팅할 거 늘었다)

 

[오류 전문]

Error output from CocoaPods:

[!] Automatically assigning platform ios with version '11.0' on target
'Runner' because no platform was specified. Please specify a platform for this target in your Podfile. See
"https://guides.cocoapods.org/syntax/podfile.html#platform'.

Exception: Error running pod install

pod install 오류였다.

뭐가 문제지... 하고 구글링 해보니 Podfile 내에 있는 ios build 타겟이 뭔가 에러가 난다는 것 같았다. 현재 플랫폼이 설정이 안 되어 있어 IOS 11.0으로 빌드를 하긴 하는데 그게 에러를 일으킨다는 뜻으로 보였다.

 

그럼 문제를 일으킨 pod file을 켜 보자.

플러터 프로젝트 내의 /ios 폴더에 들어가면 PodFile이 존재한다. 이 파일 내에서

사진과 같이 platform : ios, "11.0" 부분을 설정해 주면 된다. 본인의 경우 해당 platform 부분이 주석 처리 되어 있어 주석을 해제해주었다.

 

 


 

2. No 'Podfile' found in the project directory 오류

 

그리고 다시 pod install을 했는데...

이번엔 No 'Podfile' found in the project directory 오류가 떴다.

Podfile을 찾을 수 없다는 뜻인데, 생각해 보니 ios 폴더 내에 Podfile이 있는데 난 ios 상위 폴더인 플러터 프로젝트 폴더에서 pod install을 진행했다...!

그래서 cd ios로 ios 폴더로 변경 후 다시 pod install

 

 


 

3. Unable to find a target named RunnerTests in project "Runner.xcodeproj', did find 'Runner' 오류

오히려 좋아 다양한 경험 해 본다

이번엔 Unable to find a target named RunnerTests in project "Runner.xcodeproj', did find 'Runner' 오류가 떴다.

찾아보니 PodFile 내에서 RunnerTests 부분을 주석 처리 해주면 된다고 해서

사진과 같이 target 'RunnerTests' do 부분부터 end 까지 주석 처리 해주었다.