crossplatformkorea / react-native-kakao-login

react-native native module for Kakao sign in.
MIT License
352 stars 134 forks source link

iOS 빌드 시 에러 관련 문의 입니다. #321

Closed great-ian closed 1 year ago

great-ian commented 1 year ago

Version of kakao-login libraries

4.2.3

Version of react-native

0.68.2

Platforms you faced the error (IOS or Android or both?)

iOS

Expected behavior

product > Archive -> 여기에서 계속 에러가 발생하는 상황입니다.

Actual behavior

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_RNKakaoLogins", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64

Archive Failed 발생

Tested environment (Emulator? Real Device?)

Any iOS Device (Macbook pro [not M1] )

great-ian commented 1 year ago

아래 같은 이슈인 것 같아서 확인 후, 알려준 여러가지 방법을 다 시도해봤으나 동작은 여전히 되지 않고 있는 상황입니다. podfile 을 다음과 같이 수정한 후에는 오류 메세지가 바뀌었습니다.

  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('RNScreens')
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    installer.pod_targets.each do |pod|
    if pod.name.start_with?('kakao-login')
    def pod.build_type;
    Pod::BuildType.static_library # get kakao_login static approach instead of dynamic one because of use_frameworks!
    end
    end
    end
  end

framework not found kakao_login

확인 부탁드립니다.

ziponia commented 1 year ago

혹시 이슈 공유되고 있나요? 아무도 이문제에 관심이 없네요... 🧐

ziponia commented 1 year ago

제 경우에는, Podfile 항목이 오류가 있었네요 😭

minju1009 commented 1 year ago

@ziponia 혹시 어떤 오류였는지 알수 있을까요? 저도 Archive시 동일한 오류가 납니다. error build: Undefined symbol: _OBJCCLASS$_RNKakaoLogins

ziponia commented 1 year ago

@minju1009 문법상의 문제였어요

정확히 기억은안나지만 post_install do |installer| 부분의 문제였어요

현재 사용하고 있는 코드 참고 해보셔요

제 환경은

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

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

target 'myapp' 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}/.."
  )

  # React Native Maps dependencies
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path

  target 'myappTests' 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)
    installer.pods_project.targets.each do |target|
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
            config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
    end
  end
end
minju1009 commented 1 year ago

@ziponia 안녕하세요. 답변주셔서 정말 감사합니다! 말씀하신대로 Podfile상 코드의 문제였고, 아래 처럼 했더니 정상 빌드 되었습니다! 도움 주셔서 감사합니다.

https://github.com/react-native-seoul/react-native-kakao-login/issues/318#issuecomment-1221563360