레이블이 issue인 게시물을 표시합니다. 모든 게시물 표시
레이블이 issue인 게시물을 표시합니다. 모든 게시물 표시

2020년 5월 11일 월요일

swift Unable to install issue! -> solution

현재까지 두가지 경우 발견 (둘다 번들아이디를 변경 후 발생함)

1. 기기내 앱의 흔적이 남아있는경우

디버깅 중에 간혹 swift Unable to install 이런 오류가 발생할 경우
해당 디바이스내 기록을 지워주면 해결 된다.

xcode > window

1) Devices and Simulators  실행


2) 해당 디바이스 우클릭! > "Show Provisioning Profiles..." 클릭


3) 에러가 발생하는 프로젝트를 선택 후  " - " 제거!


4) Done을 누른뒤 다시 실행하면 오류가 없어진걸 확인가능!


2. Extension 을 사용시 번들 아이디를 바꿔도 발생

1) 프로젝트에서 하단에 임베드한 위젯을 없애고나서 다시 추가한다.


2) 프로젝트의 설정에서 Build phases 으로 이동




3) 아래 항목을 선택하여




4) 네모칸을 체크 해준다




2020년 2월 24일 월요일

ios framework linker command failed with exit code 1 (use -v to see invocation)


 ios framework linker command failed with exit code 1 (use -v to see invocation) ...
 FrameWork 를 못찾겠다며 뜨는 이슈


왼쪽 framework 폴더에서 붉게 표시된 파일들을 삭제시 해결
붉게 된 표시가 없고 연한 흰색으로 표시도 됨 

2020년 2월 23일 일요일

Mac 업데이트 후 cocoapods 이슈 발생 ..ruby: no such file or directory

zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

Mac 업데이트 후 생긴 오류

새로 설치하면 해결
터미널 실행 > sudo gem install cocoapods  > pod install 설치

2019년 9월 3일 화요일

Xcode error "The maximum number of apps for free development profiles has been reached" 오류 해결

개발자 계정없이 여러앱을 빌드 하다보면 발생하는 오류
"The maximum number of apps for free development profiles has been reached"


해결방법 (Xcode 10.3)

Xcode -> Window -> Devices and Simulators

하단의 INSTALLED APPS에서 
빌드했던 앱들을 삭제

2019년 6월 26일 수요일

Xcode change Provisioning Profile - 다른 프로비저닝 프로필 적용 (시스템 키체인 암호 입력 창 계속 뜨는 이슈 해결방법 포함) - @@ in Swift4.2.1 - Xcode 10.2.1

다른 프로비저닝 프로필을 가진 프로젝트를 빌드 할때 인증서 문제가 발생합니다.
이를 해결하기 위해선 프로젝트 만들시 사용된 프로비저닝 프로필을 Import 해서 빌드를 해야 합니다.


프로비저닝 프로필 두개 (개발용 배포용)과 인증서 파일 (.p12)  필요

* 프로비저닝 프로필을 만들때 디바이스의 UUID를 사용한다.
Xcode 실행  -> Windows -> Devices and simulators 로 들어가 UUID를 확인





그렇게 만들어진 프로비저닝 프로필 파일 두개와 인증서 파일 (p.12) 를 받았으면
Xcode를 실행하여 프로비저닝 프로필을 Import 한다.





그럼 붉은색 느낌표가 나타나면서 이슈가 발생하는데 이는 인증서 문제로 p.12 인증서 파일을 실행하여
인증서를 추가하면 해결 된다.

*총 세개의 인증서가 추가
 Apple Worldwide Developer....
 iPhone Developer:...
 iPhone Distribution:..

Xcode를 다시 실행하면 이슈가 해결된걸 확인 할 수 있습니다.




이제 빌드를 시작하면 또 다른 이슈 아닌 이슈가 발생합니다.




키체인을 사용하기 위해 관리자 이름과 암호를 입력해야 하는데
입력을 하고 허용을 눌러도 계속 뜨게 됩니다. (계속 입력하면 없어진다는 말도 있습니다)

일단 유틸리티에서 ->"키체인 접근" 을 열어 시스템 키체인을 확인합니다
iOS Developer....
iOs Distributi... 



라는 두개의 개인키가 추가 되어 있는것을 확인합니다.
*만약 없다면 빌드를 하여 두세번 정도 관리자 이름과 암호를 입력하고 키체인 접근 프로그램을 재실행
하면 추가 될 것입니다.

iOS Developer.... 개인 키를 열어 "접근제어" -> 모든 응용 프로그램이 이 항목.. 을 체크 -> 변경사항 저장 -> 관리자 이름과 암호 입력

"키체인 접근" 프로그램을 닫고 빌드를 하면 암호 입력창이 뜨지 않고 성공적으로 빌드가 됩니다.



iPhone has denied the launch request 이슈 해결

빌드중에 iPhone has denied the launch request ....  이런 이슈가 발생하는 경우

Commad  + shift + k 눌러 프로젝트 클린을 해보세요 !

2019년 6월 19일 수요일

Could not locate device support files. 이슈 해결



디바이스의 iOS 버전이 높아 X code 앱 빌드 시 발생하는 오류!
해결 방법은 간단하다.
X code 를 업데이트 합니다 (업데이트가 귀찮으시면 해당 디바이스의 버전의 빌드 파일을 따로 다운로드하여 X code에 추가 해주는 방법도 있습니다)

"codesign wants to access key "access" in your key chain." 이슈 해결


"codesign wants to access key "access" in
your key chain.



X-code 앱 빌드 시 "Codesign 이 "Access" 키체인 액세스 하기위해 암호를 입력하라는 창이 계속 뜬다면 맥북 사용자 암호 입력 항상허용을 눌러주세요




2017년 7월 11일 화요일

CFBundleVersion Mismatch - The CFBundleVersion value '1' of extension.. 이슈

앱을 아카이브로 생성 후 업로드 시 발생 할 수 있는 오류
익스텐션을 추가하여 작업하였을 경우 앱의 번들  빌드 버젼과 익스텐션의 빌드 버젼이 다를 시
나타나는 오류로 

아카이브 생성전에
앱의 번들버전과 = 익스텐션의 번들버전
앱의 빌드버전 = 익스텐션의 빌드버전

같도록 해야하다



2017년 5월 15일 월요일

Xcode "no suitable image found" 이슈 해결

Reason: no suitable image found.  Did find:

    /Users/name/Documents/proj-name: required code signature missing for '/Users/name/Documents/proj-name/Frameworks/Project.framework/Project'

...



디버깅중에 위 같은 이유로 이슈가 발생한다면 
아래 방법으로 해결이 될 수 있다 (원인이 다를 수 있으므로)
CMD+Option+Shift+K 

2016년 12월 6일 화요일

UIViewController, Dismiss and Present @@ in Swift3 - Xcode 8.0 iOS 10

기존에 열려있는 firstViewController 를 Dismiss 하고 secondViewController를 Present 하기 위해
---------------------------------------------------------------------------------------
self.dismiss(animated: true, completion: {
  let vc = self.storyboard?.instantiateViewController(withIdentifier: "secondViewController")
  self.present(vc!, animated: true, completion: nil)
})
=========================================================================
아래 오류가 뜬다.
whose view is not in the window hierarchy!


이때는 뷰계층구조상 rootViewController를 사용해야한다.
---------------------------------------------------------------------------------------
self.dismiss(animated: true, completion: {
   let vc = self.storyboard?.instantiateViewController(withIdentifier: "secondViewController")
   let appDelegate = UIApplication.shared.delegate as! AppDelegate
   appDelegate.window?.rootViewController!.present(vc, animated: true, completion: nil) 
})
=========================================================================

이렇게 하면 기존의 firstViewController는 닫히고 secondViewController 가 열린다

2016년 12월 5일 월요일

coreData Entites 이슈 @@ in Swift3 - Xcode 8.0 iOS 10



코어데이터의 Entites 생성하고 Attributes 값을 추가한 다음
xcode - > Editor -> createNSManagedObject SubClass.. 를 클릭하여
파일이 생성된 후 빌드 시 아래 이슈가 발생한다면

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1


코어데이터의 Entites를 선택하여 우측 inspector 탭을 눌러
Class 항목의 Codegen을 Manual/None 로 선택하여 빌드하면 이슈가 사라진다

2016년 12월 4일 일요일

Archive 가 비활성화 되는 경우 해결법! @@ in Swift3 - Xcode 8.0 iOS 10

xcode  ->  product -> Archive 가 비활성화 되는 경우 해결법!

시뮬레이터로만 빌드하였을 경우 Archive 항목이 비활성화 되는 경우가 발생한다

그땐 디바이스를 연결하여 빌드하면 활성화 된다.

2016년 11월 1일 화요일

photoLibrary 접근 시 발생하는 이슈 @@ in Swift3 - Xcode 8.0 iOS 10

iOS 10으로  업데이트 되면서 사용자 데이터 접근 시 변경된 내용이 있다

예를 들어 사용자의 photoLibrary 에 접근 시  이슈가 발생 한다

<이슈 내용>
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data. 



업데이트가 되면서 사용자 데이터 접근하려면 사용목적을 따로 입력해야 한다

photoLibrary 경우 접근을 하려면 NSPhotoLibraryUsageDescription키를 사용한다.

Info.plist파일을 열어
위 이미지 처럼 Key 값을 추가 하고 사용목적을 입력한다

앱을 실행하여 photoLibrary 에 접근 하면 이슈가 해결되고 알럿창이 뜬다

photoLibrary 외에도  미디어 라이브러리, 카메라, 연락처, 위치정보 등 사용자 데이터에 접근 시 필수적으로 사용목적을 입력해야한다.



아직 정확한 원인이 파악되지 않았으나 Library 접근하는 view에서  디버깅 시 아래 같은  이슈가 발생하는 경우가 있다

<이슈 내용>
Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x1198125910) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x11c77c210). One of the two will be used

임시방편으로 아래코드처럼  AssetsLibrary framework를 import 해주면 디버깅에서 아래오류를 없앨수 있다

import AssetsLibrary 



2016년 9월 14일 수요일

UICollectionView Cell checkbox 이슈 해결 @@ in Swift2.x - Xcode 7.3 iOS 9.3

이어서 지난 번 CheckBox 코딩의 이슈를 해결코자 한다.
[이슈 내용]
1. 선택된 체크박스가 중복되어 나타난다, 즉 아래로 스크롤 시 체크하지 않았던 체크박스도 체크가 된 상태로 나타나는 경우

2. 스크롤 후 다시 원위치 시 체크박스된 박스가 위치가 바뀌는 현상

일단 두가지 이슈의 공통점은 버튼마다 특정 값을 가지고 있지 않다는 것이다.
다시말해 몇번째 Cell의 Checkbox인지 확인이 어렵다는것이다.

그래서 CheckBox 클래스 값에 변수를 만들어 그 변수에
Cell의  indexPath.row 값을 넣기로 했다
------------------------------------------------------------------------------------------
class CheckBox: UIButton {
    // Images
    
    let checkedImage = UIImage(named: "photoSelect_active")! as UIImage
    let uncheckedImage = UIImage(named: "photoSelect_deactive")! as UIImage

    var tagCount: Int = 0
==========================================================================

------------------------------------------------------------------------------------------
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier("CollectionCell", forIndexPath: indexPath) as! AlbumPhotoCollectionViewCell
       
        ...
          cell.checkBoxbutton.tagCount = indexPath.row
          
          ...
        return cell

    }
==========================================================================

이렇게 하면 일단 버튼 마다 특정 값을 가지게 할 수 있다.
하지만 이슈처리하는데 가장 풀리지 않았던 문제는 CheckBox 의 중복 되는 문제
하여 CheckBox 클래스 안에서 특정 값을 이용해 Check 표시를 하는 메소드를 만들어보기로 했다.
이렇게 하게 된 가장 큰 이유는 CollectionView 에서 Cell 이 화면에 나타날때마다 객체를 새로 생성
하게 됨을 알게 되었고 생성 될때마다 실행하는 함수를 넣게 될 경우 중복되는 문제를
해결 할 수 있을거라 생각 하였기 때문이였다

일단 tagCount 라는 변수를 이용해 Check 여부를 확인 하는 메소드를 CheckBox 클래스 안에 만들다
------------------------------------------------------------------------------------------
func checkdconform(){
        if GridPhotosHelper.collectionViewCellDic[tagCount] == nil {
            self.isChecked = false
        }else{
           self.isChecked = true
        }
    }
==========================================================================

GridPhotosHelper.collectionViewCellDic[tagCount] 이 값은 체크박스 클릭 시 
tagCount를 key 값으로 딕셔너리로 저장하도록 선언 해놓은 변수이다.
------------------------------------------------------------------------------------------

public struct GridPhotosHelper {

 static var collectionViewCellDic : Dictionary = [Int : Bool]()
...
}
==========================================================================

CheckBox 클래스 내 버튼 클릭 함수에 true, false 값에 따라 딕셔너리로 저장하거나 삭제하도록 코딩을 추가 해준다
------------------------------------------------------------------------------------------
 func buttonClicked(sender:UIButton) {
        print(tagCount)
        if(sender == self){
            if isChecked == true{
                isChecked = false
                GridPhotosHelper.collectionViewCellDic[tagCount] = nil   
            }else{
                isChecked = true
                GridPhotosHelper.collectionViewCellDic[tagCount] = true
            }
        }
    }
==========================================================================
끝으로 객체가 생성 될때마다 위 함수를 실행하도록 코딩을 추가한다
------------------------------------------------------------------------------------------
 func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier("CollectionCell", forIndexPath: indexPath) as! AlbumPhotoCollectionViewCell
        
        
          cell.checkBoxbutton.tagCount = indexPath.row
          cell.checkBoxbutton.checkdconform()
          
     ...
        return cell

    }
==========================================================================

앱을 테스트 해보면 이슈들이 해결된것을 확인 할 수 있고 체크된 Checkbox 의  값들도
딕셔너리에 따로 저장된다.

2016년 9월 13일 화요일

UICollectionView Cell checkbox 사용 @@ in Swift2.x - Xcode 7.3 iOS 9.3

오늘은 UICollectionView Cell 마다 Checkbox 기능을 추가 할 예정이다.
일단 Checkbox를 넣는 이유는 Poster라이브러리에서 자신이 선택하고 싶은 사진들을 표시하기
위해서이다.

내가 가지고 있는 교재에선 참고할만한 예제가 없어 구글링을 하여 코딩했다.

무슨 이유인지 아직 모르지만 아래코딩은 Checkbox가 중복체크가 된다.(첫 화면에 Checkbox를 체크 하고 스크롤 하여 아래로 내리면 체크하지 않았던 Checkbox에 체크 표시가되어있는 문제가 발생)

그래도 일단 코딩을 정리하고 이슈를 해결 할 예정이다.
----------------------------------------------------------------------------------------------
class CheckBox: UIButton {
    // Images
    
    let checkedImage = UIImage(named: "photoSelect_active.png")! as UIImage
    let uncheckedImage = UIImage(named: "photoSelect_deactive.png")! as UIImage
    
    // Bool property
    var isChecked: Bool = false {
        didSet{
            if isChecked == true {
                self.setImage(checkedImage, forState: .Normal)
            } else if isChecked == false {
                 print("test2!!")
                self.setImage(uncheckedImage, forState: .Normal)
            }
        }
    }
    override func awakeFromNib() {
        self.addTarget(self, action: #selector(CheckBox.buttonClicked(_:)), forControlEvents: UIControlEvents.TouchUpInside)
        self.isChecked = false
    }
    
    func buttonClicked(sender:UIButton) {
        if(sender == self){
            if isChecked == true{
                isChecked = false
               
            }else{
                isChecked = true
               
            }
        }
    }

}
=============================================================================
위 코딩은 구글링을 통해서 체크버튼 클릭 마다 isChecked 값에 따라 이미지를 바꿀수 있도록 한다.
스토리보드 버튼에 위 클래스 값을 넣었다. 참고로 버튼 타입을 "Custom"으로 해주어야만 
이미지가 제대로 나온다.

체크 이미지와 미체크 이미지를 설정 해주고
----------------------------------------------------------------------------------------------
    let checkedImage = UIImage(named: "photoSelect_active")! as UIImage
    let uncheckedImage = UIImage(named: "photoSelect_deactive")! as UIImage
=============================================================================
속성 값에 따른 이미지 배치
----------------------------------------------------------------------------------------------
 // Bool property
    var isChecked: Bool = false {
        didSet{
            if isChecked == true {
                self.setImage(checkedImage, forState: .Normal)
            } else if isChecked == false {
                self.setImage(uncheckedImage, forState: .Normal)
            }
        }
=============================================================================

클래스 시작 시 처음 실행되는 함수 버튼에 터치 함수를 넣어주고 버튼의 속성값을 false 로 설정
----------------------------------------------------------------------------------------------
 // Bool property
override func awakeFromNib() {
        self.addTarget(self, action: #selector(CheckBox.buttonClicked(_:)), forControlEvents: UIControlEvents.TouchUpInside)
        self.isChecked = false
    }
=============================================================================
체크버튼에 들어간 클릭 함수, 클릭마다 속성이 바뀐다
----------------------------------------------------------------------------------------------
 func buttonClicked(sender:UIButton) {
        if(sender == self){
            if isChecked == true{
                isChecked = false
            }else{
                isChecked = true
            }
        }
    }
=============================================================================
스토리보드의 버튼의 클래스 값에 적용 후 테스트를 해보면 
체크버튼이 클릭 될때마다 이미지가 바뀌는것을 확인 할 수 있으나 이슈가 발생한다.

[이슈 정리]
1. 선택된 체크박스가 중복되어 나타난다, 즉 아래로 스크롤 시 체크하지 않았던 체크박스도 체크가 된 상태로 나타나는 경우

2. 스크롤 후 다시 원위치 시 체크박스된 박스가 위치가 바뀌는 현상



2016년 7월 6일 수요일

"Could not load the "(null)" image referenced from a nib in the bundle with identifier "" 이슈 해결

<이슈>

"Could not load the "(null)" image referenced from a nib in the bundle with identifier "<app bundle>"

<해결>

위 이슈가 발생 하는것은 스토리 보드 의 imageView 이미지 로드 실패하여 나타나는 메세지이다
imageView 삭제 하거나 이미지 이름 확인하여 수정한다

2016년 1월 31일 일요일

Transport Security has Blocked a cleartext HTTP 문제해결 @@ in Swift2.x

Transport Security has Blocked a cleartext 이슈 해결 방법

 info.plist 파일을 열어 키값을 추가한다.
<info.plist 파일>
<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>localhost</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>TLSv1.1</string>
            </dict>
        </dict>
    </dict>
<추가 할 키 값>
<key>NSAppTransportSecurity</key>
<dict>
  <!--Include to allow all connections (DANGER)-->
  <key>NSAllowsArbitraryLoads</key>
      <true/>
</dict>

추천 게시물

애플 개발자 등록방법 2016년 5월 8일 기준!!

애플 개발자 등록 절차 1. 개발자 등록 페이지 이동    애플 개발자 로그인 > Account 페이지 이동 > 하단 영역 클릭 (이미지 참조)   >> Enroll 클릭 >> 무조건 승인!! ...