728x90

분명 아카이브가 잘되고 앱스토어 커넥트에 업로드가 성공했다고 나오는데,

실제로 앱스토어 커넥트에 빌드 란을 보면 아무 항목도 나오지 않을 때가 있다.

 

이 경우에는 개발자 계정에 연결된 메일을 확인해본다.

아래와 같이 사유를 안내해주면 Learn more를 눌러 관련 조치를 해준 후 다시 업로드를 하면 정상적으로 등록이 되는 걸 볼 수 있다.

 

내 경우엔 문제가 되는 UIWebView 관련 코드를 모두 주석처리하니 해결되었다. (RNWebview를 쓰고 있어서 해당 코드없이도 앱 실행에 문제 없었음)

 

ITMS-90809: Deprecated API Usage - App updates that use UIWebView will no longer be accepted as of December 2020. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

728x90

앱 소스가 아닌 프론트엔드 소스 코드를 아래와 같이 수정 ( #t=0.001 추가)

 

<video controls  preload="metadata" src="~/assets/img/video.mp4#t=0.001">
728x90

1. Images에 로고 이미지 추가 

2. LaunchScreen > View항목 선택 후 우상단의 + 눌러 Image View 추가

3. 레이아웃 제약 조건 설정

  • 반드시 Layout의 Inferred (간접) 오토리사이징 마스크를 선택한다

  • 제약 조건을 추가 하여 상하좌우 등의 항목을 설정 (간격핀 안 쪽 영역을 클릭하여 빨강으로 보이게 설정한 후 Add. x Constraints를 누른다)

728x90

Showing All Messages

Command PhaseScriptExecution failed with a nonzero exit code

 

PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/(...)/Build/Intermediates.noindex/Pods.build/Release-iphoneos/FBReactNativeSpec.build/Script-46EB2E0001B930.sh (in target 'FBReactNativeSpec' from project 'Pods')

 

와 같은 오류가 뜰 때

 

clean build나 pod 재설치로도 해결이 안된다면 

node 문제일 수 있다.

 

- 임시적인 해결법

sudo vi node_modules/react-native/scripts/find-node.sh

 

다음줄 주석처리 ( --no-use 뒤부터와 그 다음 줄)

# Source nvm with '--no-use' and then `nvm use` to respect .nvmrc
# See: https://github.com/nvm-sh/nvm/issues/2053
if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
  # shellcheck source=/dev/null
  . "$HOME/.nvm/nvm.sh" #--no-use
  #nvm use 2> /dev/null || nvm use default
elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then
  # shellcheck source=/dev/null
  . "$(brew --prefix nvm)/nvm.sh" #--no-use
  #nvm use 2> /dev/null || nvm use default
fi

 

참고

https://stackoverflow.com/questions/66742033/phasescriptexecution-cp-user-error-in-react-native

 

PhaseScriptExecution [CP-User] error in React Native

Nowadays everytime I create a new project react-native init ProjectName and after it is created I do npx pod-install and then react-native run-ios it gives me error. It happens with every project t...

stackoverflow.com

 

하지만 위 임시적인 해결법으로는 패키지 변경 후 재설치마다 find-node.sh파일이 바뀌기 때문에

nvm과 node 제거 후 클린설치를 하는 것이 좋다.

 

이후 빌드 시의 노드 버전과 which node로 node 경로를 확인하고 환경변수가 잘 설정되어있는지 확인 후에 재빌드하면 될 것이다.

728x90

업데이트 심사는 어려운 부분은 없었는데 새 버전 추가를 어디서하는지 헤맸는데 그냥 저 + 버튼을 누르면 되는 거였다...

앱스토어 커넥트 - 나의 앱에서 + 눌러서 새버전 생성

 

xcode 프로젝트의 빌드버전에 맞춰 생성 후 

이 버전에서 업그레이드된 사항을 적고 새 빌드를 제출하면 된다.

 

빌드버전은 해당 프로젝트의 TARGETS - General - Identity에서 확인할 수 있다. (업데이트 시 반드시 Version외에도 Build 숫자를 올려야한다. 일반적으로 1씩 증가)

빌드 제출은 아카이브 후에 Window - Organizer에서 해당 아카이브 선택 해 Distribute App을 선택 해 전행하면 된다.

728x90

This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. You may also need to restart your mac and device in order to correctly detect compatibility.

 

xcode에서 빌드는 성공했는데 이런 오류가 뜨면서 앱 실행이 안된다면 확인해볼게 3가지

 

1. xcode 버전 확인

2. iOS 버전 확인

3. 버전의 문제가 아니라면 폰 재시작

728x90

이 방법으로 꼭 해결된다기보다 해볼 수 있는 것들

 

1. Podfile이 잘못되었는지 확인

: 잘못된 프로젝트 타겟 네임 수정하거나 주석처리

#target 'react_app-tvOS' do
  # Pods for react_app-tvOS

#  target 'react_app-tvOSTests' do
#    inherit! :search_paths
 
  ### Pods for testing
  
  #end

2. 리액트 네이티브 CLI 전역 제거

npm uninstall -g react-native-cli

 

3. 특정 환경변수 제거

 unset NODE_EXTRA_CA_CERTS

 

4. cocopods 파일 제거

rm -rf ~/.cocoapods/repos/trunk/\n

 

5. m1 mac에서 pod install하면 ffi 에러날 시

(...) tried: '/opt/homebrew/lib/ruby/gems/3.1.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /opt/homebrew/lib/ruby/gems/3.1.0/gems/ffi-1.15.5/lib/ffi_c.bundle (LoadError)

( ... )

 

- 기존 패키지 제거하고 재설치

brew uninstall --ignore-dependencies ruby
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-downloader

6. 저장소 업데이트하고 다시 install

pod repo update

pod install

 

 

7. Podfile

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target 'reactApp' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'reactAppTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

8. requireNativeComponent: "RNCWebView" was not found in the UIManager 에러 날 시

-> 리액티 네이티브, 웹뷰 패키지 설치 확인 후 npm i

 "react": "18.0.0",
    "react-native": "0.69.0",
    "react-native-webview": "11.22.3"

-> pod install 명령어를 vs code 터미널이 아닌 iTerm을 사용해 입력

 

9. target error 시

[!] CocoaPods could not find compatible versions for pod "React-RCTSettings":
  In Podfile:
    React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)

Specs satisfying the `React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)` dependency were found, but they required a higher minimum deployment target.

위와 같은 오류가 나면 Podfile의 타겟을 올린다.

platform :ios, '12.4'

 

이런저런 과정들을 수행했는데도 제대로 pod install 이나 빌드, 앱 실행이 잘 안된다면 package, package-lock.json 의존성을 잘 살펴보자. 필요한 의존성 패키지가 설치되지 않아서일 가능성이 있다.

(...)
 "node_modules/@react-navigation/stack": {
      "version": "6.2.1",
      "resolved": "https://registry.npmjs.org/@react-navigation/stack/-/stack-6.2.1.tgz",
      "integrity": "sha512-JI7boxtPAMCBXi4VJHVEq61jLVHFW5f3npvbndS+XfOsv7Gf0f91HOVJ28DS5c2Fn4+CO4AByjUozzlN296X+A==",
      "dependencies": {
        "@react-navigation/elements": "^1.3.3",
        "color": "^3.1.3",
        "warn-once": "^0.1.0"
      },
      "peerDependencies": {
        "@react-navigation/native": "^6.0.0",
        "react": "*",
        "react-native": "*",
        "react-native-gesture-handler": ">= 1.0.0",
        "react-native-safe-area-context": ">= 3.0.0",
        "react-native-screens": ">= 3.0.0"
      }
(...)

 

728x90
             if #available(iOS 13.0, *) {
                            /**
                             In iOS 13 and above WKWebViews in iPad has the ability to render desktop versions of web pages.
                             One of the properties they change to support this is the User-Agent.
                             Therefore forcing the WKWebView to load the mobile version.
                             */
                            let pref = WKWebpagePreferences.init()
                            pref.preferredContentMode = .mobile
                            config.defaultWebpagePreferences = pref
                        }

위와 같이 iOS13에서는 WKWebpagePreferences의 속성에 preferredContentMode를 설정할 수 있다. 

https://developer.apple.com/documentation/webkit/wkwebpagepreferences/3194426-preferredcontentmode?language=objc 

 

Apple Developer Documentation

 

developer.apple.com

preferredContentMode는 enum상수로 3가지 옵션이 정의되어있다 (2022.4.6 기준)

extension WKWebpagePreferences {

    
    /** @enum WKContentMode
     @abstract A content mode represents the type of content to load, as well as
     additional layout and rendering adaptations that are applied as a result of
     loading the content
     @constant WKContentModeRecommended  The recommended content mode for the current platform
     @constant WKContentModeMobile       Represents content targeting mobile browsers
     @constant WKContentModeDesktop      Represents content targeting desktop browsers
     @discussion WKContentModeRecommended behaves like WKContentModeMobile on iPhone and iPad mini
     and WKContentModeDesktop on other iPad models as well as Mac.
     */
    @available(iOS 13.0, *)
    public enum ContentMode : Int, @unchecked Sendable {

        
        case recommended = 0

        case mobile = 1

        case desktop = 2
    }
}

 

웹뷰 초기화시 정의한 config를 넘기면 된다.

WKWebView(frame: rect, configuration: config)

 

 

참고

https://developer.apple.com/forums/thread/674232

 

How to force WKWebView to show mob… | Apple Developer Forums

Assuming the website you are loading uses User-Agent to change content/layout/presentation the following will work. let config = WKWebViewConfiguration() if #available(iOS 13.0, *) { /** In iOS 13 and above WKWebViews in iPad has the ability to render desk

developer.apple.com

 

728x90

서드파티앱에서 내 앱으로 이동할 수 있게 하려면 (예: 결제취소,완료 시의 리다이렉트) 앱 스키마를 등록해줘야한다.

info.plist 의 URL types에 Add Row하여 URL types와 그 하위 항목들 추가

 

value에는 URL identifier에 패키지 이름 작성, URL Schemes의 아이템에는 (0부터 시작) 식별할 수 있는 앱 스키마 이름을 작성한다.

이후 새로 빌드

 

728x90

Xcode에서 Info.plist 에 Row 추가

 

아래와 같이 key 선택 후 value는 자유롭게 추가 후 새로 빌드

+ Recent posts