your programing

번들에서 'Main'이라는 스토리 보드를 찾을 수 없습니다.

lovepro 2020. 12. 26. 16:18
반응형

번들에서 'Main'이라는 스토리 보드를 찾을 수 없습니다.


'Could not find a storyboard named 'Main' in bundle NSBundle'실제 iOS 기기에서 내 앱을 실행하려고 할 때 이상한 오류가 발생 합니다.

내 디렉토리에 파일이 있고 시뮬레이터에서 잘 작동합니다. 그러나 Copy Bundle Resources섹션에서 파일 Main.storyboard은 빨간색입니다.

나는 그것을 제거하고 다시 추가하고, Xcode를 다시 시작하고, 빌드를 정리하려고 시도했습니다. 이것은 Xcode에서 얻는 경고입니다.

/Users/ajay/Documents/avx/avx/Base.lproj/Main.storyboard: Internationalization of /Users/ajay/Documents/avx/avx/Base.lproj/Main.storyboard is not available when compiling for targets before iOS 6.0

프로젝트의 info.plist를 열고 스크린 샷에 표시된 선택한 행을 제거합니다.여기에 이미지 설명 입력

검은 색 화면이 나타나면 새 초기 스토리 보드가 기본 인터페이스로 선택되었는지 확인하십시오. 여기에 이미지 설명 입력


스토리 보드의 대상 멤버십을 확인할 수 있습니다. 문제가있는 곳이있을 수 있습니다.

다음과 같이 보일 것입니다.

대상 멤버십


휴대폰에서 앱을 삭제하고 Product-> Clean을 수행 한 다음 다시로드했습니다. 그게 전부입니다.


이 오류가 발생했지만 스토리 보드를 완전히 제거하려는 의도였습니다.

내 plist에서 'Main Storyboard file base name'키를 제거하면 오류가 해결되었습니다.


번들에서 'Main'이라는 스토리 보드를 찾을 수 없습니다.

내가 생각할 수있는 이유 :

내 iOS 지식이 결론을 내리는 한, 이것은 XCode가 내 프로젝트 디렉토리 내에서 Main.storyboard 파일에 대한 참조를 찾아 앱에 복사 할 수 없기 때문에 발생했습니다.

해결:

  1. Main.storyboard 파일을 선택하고 삭제를 시도했으며 다음과 같은 팝업 대화 상자에서 : 여기에 이미지 설명 입력

  2. "참조 제거"버튼을 클릭했습니다.

  3. 그런 다음 프로젝트 디렉터리 내에서 Main.storyboard 파일을 찾을 수있는 실제 위치에서 XCode로 끌어다 놓은 다음 다음과 같이 팝업되는 대화 상자에서 다시 가져옵니다. 여기에 이미지 설명 입력

  4. "폴더 참조 생성"을 선택했습니다 (프로젝트의 파일 및 폴더 구조를 변경했기 때문에이 작업을 수행하려고했기 때문입니다). 그러나 대부분의 경우 "그룹 만들기"를 선택하는 것도 효과적 일 수 있습니다. 그리고 "마침"버튼을 클릭했습니다. 내 스토리 보드 파일은 Base.lproj다음과 같이 이미 디렉토리 내에있는 스크린 샷에 표시된대로 이미 있습니다.

    여기에 이미지 설명 입력

    참고 : 이 단계에서 기억해야 할 한 가지 중요한 사항은 앱의 "대상에 추가"확인란을 선택하는 것을 잊지 마십시오.

  5. 제품을 청소하고 다시 빌드하십시오. 성공하면 대부분의 경우 성공적으로 실행 해보십시오.

이것이 다른 누군가에게 도움이되기를 바랍니다! 나는 XCode 7.3.1과 iOS Sim 9.3 및 iPhone 6S에서 이것을 시도했습니다!


시뮬레이터는 대소 문자를 구분하지 않지만 장치는 구분합니다. 스토리 보드가 MainStoryBoard가 아니라 MainStoryboard 인 경우 문제가 발생합니다. 그리고 * 확장 기능을 사용하지 말고 스토리 보드 이름 만 작성하십시오.

main.storyboard-> 메인스토리 보드 이름입니다.


다음 단계를 따르십시오.

1) 먼저 스토리 보드를 클릭하세요

2) 그런 다음 File Inspector를 클릭하십시오.

3) 그런 다음 "Target Membership"을 선택합니다.

스크린 샷


  1. 스토리 보드 파일 열기
  2. 그런 다음 파일 검사기를 클릭하십시오.
  3. 그런 다음 "Target Membership"을 선택하고 프로젝트를 확인하십시오.
  4. ViewController 파일에 대해서도 똑같이하십시오 !!! 스토리 보드와 함께 ViewController.swift 또는 ViewController.m을 사용하는 경우 중요한 부분 !!!

plist에서 행을 삭제하면 내 앱에서도 검은 화면이 발생했습니다. 그리고 스토리 보드의 대상 멤버십활성화하여 수정했습니다.


As Kalpit Gajera has said, "open the info.plist of your project and remove the selected row displayed in screenshot". You simply remove 'Main storyboard file base name' from the Info.plist. After you remove it, clean and run, the program will no longer fail but will show a black screen. Open Info.plist again and manually add the row back in. Problem solved.


Two different solutions that worked for me after upgrading to Xcode 10.1:

  • In File->Workspace (or Project) Settings. Switch to Legacy Build System.

  • In your targets Build Phases, remove the Base.lproj folder from Copy Bundle Resources (if listed) and make sure each of your storyboards are listed and copied separately instead.

After applying either of the fixes above make sure you Clean Build Folder from the Product menu once, otherwise the fixes might not work properly.


choose main.storyboard, change the view as iOS 6.1 and earlier, then xcode will tell u what u need to do.

여기에 이미지 설명 입력


My solution is:

When i added a Seque Connection between two Views and in the Projekt Configuration the Deployment Target is less then 8.0 i get this error.

ok, easy understanding when you develop for IOS 6.0 (for example) you can't use Seque, because the Seque needs IOS 8.0 or later...... ;-)

so, i set the Deployment Target to 8.0 and the error is gone !!!! other while, i cancel all the Segue Connections and handle it with IBAction, old school ;-)


I was moving Main.Storyboard file to "blue" sub folder which was causing issues, I had to add sub folders following these instructions Xcode 6.3 New File Issue

then moving Main.Storyboard file to yellow sub folder did work for me


My issue was resolved by removing the .xml suffix from the Main.storyboard.xml file.

Apparently, the suffix changed from the version from which I imported the project.

Therefore, renaming the file (removing the .xml suffix) and restarting, then Project-> clean.... fixed the problem.


Ok this has been a process. Trying so many different things. Running xcode 6.4 on OS 10.11. Having the cannot find 'Main' problem. What I finally did was move the main.storyboard off on too my desktop from Finder.Did a clean and build and quit xcode. restarted xcode now it has a red main.storyboard. i run it virtually does the same thing. then I right click on the project folder and choose the option add files to... Browse to where it is and open it. then when it is there to the right should be the identities inspector. click on the small folder under location. browse to that folder again and select choose. Then I ran and it worked. Amen !!!

ReferenceURL : https://stackoverflow.com/questions/19240054/could-not-find-a-storyboard-named-main-in-bundle

반응형