crossplatformkorea / react-native-kakao-login

react-native native module for Kakao sign in.
MIT License
360 stars 136 forks source link

[ERROR] Stored properties cannot be marked potentially unavailable with '@available' #326

Open JJalit opened 2 years ago

JJalit commented 2 years ago

Version of kakao-login libraries

5.1.1

Version of react-native

0.69.5

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

ios

Expected behavior

시뮬레이터 실행

Actual behavior

KakaoSDKAuth AuthController.swift 파일에서 Stored properties cannot be marked potentially unavailable with '@available' 에러발생

Tested environment (Emulator? Real Device?)

Xcode 14 ios Emulator

스크린샷

Screen Shot 2022-09-13 at 11 46 12 AM
kmsbernard commented 2 years ago

라이브러리에서 카카오 SDK 버전을 2.11.1로 업그레이드하여 해결할 수 있을듯합니다:

kmsbernard commented 2 years ago

네이티브 SDK에 별다른 breaking change가 없다면 제가 PR을 올려볼 수 있을것 같아요.

kdh0324 commented 2 years ago

해당 사항 때문에 저도 머리를 싸매고 있는데 혹시 별다른 해결 방안이 없을까요? 2.11.1로 upgrade를 하여도 react native module에 어떻게 반영을 해야할지 모르겠습니다ㅠ

andrei0807 commented 2 years ago

어떻게 2.11.1로 업데이트 하는가요?

bashruv commented 2 years ago

지금 해당 이슈로 저도 골머리 앓고 있는데, 도움이 되실지는 모르겠지만 저 나름대로 임시방편으로 2.11.1 강제 업데이트해서 진행한 내용을 적어봅니다!

  1. node_modules@react-native-seoulkakao-loginkakao-login.podspec

    kakao_sdk_version = "2.11.1"
  2. (Symbol Not Found 이슈 발생 시) 프로젝트 iosPodfile

    post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
      end
    end
    end

이렇게 진행했을 때 문제 없이 실행됐었습니다!

greeed2b commented 2 years ago

혹시 KakaoSDKFriend 에서 Alamofire 를 못 찾는 에러는 안 나셨나요?

floydkim commented 2 years ago

올려보고있는데 저도 Alamofire 에러 납니다

Library not loaded: @rpath/Alamofire.framework/Alamofire
JJalit commented 2 years ago

카카오 SDK 버전을 2.11.1로 변경하여도 계속되는 오류 때문에 스트레스를 많이 받다가 제가 올린 이슈에 한해서 해결책을 찾은 거 같습니다. 한번 해보시면 좋을듯 합니다

먼저, sdk upgrade를 안해도 되고 기존 @react-native-seoul/kakao-login 버전도 그대로 유지했습니다.

다음으로, Xcode를 열어 Pods 폴더에서 KakaoSDKAuth의 AuthController.swift에서 다음과 같이 코드를 수정합니다.

<예시> Screen Shot 2022-09-14 at 4 05 02 PM

Screen Shot 2022-09-14 at 4 22 56 PM

<추가 코드> public var presentationContextProvider: Any?

if #available(iOS 13.0, *) { self.presentationContextProvider = DefaultPresentationContextProvider() } else { self.presentationContextProvider = nil }

마지막으로, 수정 후 다시 빌드해 주세요.

greeed2b commented 2 years ago

저는 KakaoSDKFriend 에서 못찾는 에러가 발생해서 kakaoSDK 전체를 가져오는 코드를 주석 했습니다. 35번째 줄입니다.

image

floydkim commented 2 years ago

오 저도 전체 SDK 불러올필요가 없다 생각돼서 주석처리하고 빌드해보려고 합니다

(update) 빌드 및 앱 구동 정상 동작하네요.

근본적인 해결책이 아니라서 KakaoSDKFriend 사용하는 분들께는 도움이 되지 않을테니 아쉽습니다..

andrei0807 commented 2 years ago

image 저도 SDK버전만 2.11.1 로 수정해서 해보니 컴파일은 되지만 실행시 Alamofire 에러가 나옵니다.

floydkim commented 2 years ago

README 보니, node_modules 수정하는 대신 카카오 SDK 버전을 직접 지정할 수 있는 방법을 마련해두셨더라구요. 이 이슈를 보시는 분들께서 참고하시면 좋을 것 같습니다.

image

Podfile 전역에 선언해두면 됩니다

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

# 없는 경우에는 package.json의 sdkVersions.ios.kakao를 따릅니다.
$KakaoSDKVersion="2.11.1"

platform :ios, '11.0'
// ....
andrei0807 commented 2 years ago

카카오 SDK 버전을 2.11.1로 변경하여도 계속되는 오류 때문에 스트레스를 많이 받다가 제가 올린 이슈에 한해서 해결책을 찾은 거 같습니다. 한번 해보시면 좋을듯 합니다

먼저, sdk upgrade를 안해도 되고 기존 @react-native-seoul/kakao-login 버전도 그대로 유지했습니다.

다음으로, Xcode를 열어 Pods 폴더에서 KakaoSDKAuth의 AuthController.swift에서 다음과 같이 코드를 수정합니다.

<예시> Screen Shot 2022-09-14 at 4 05 02 PM

Screen Shot 2022-09-14 at 4 22 56 PM

<추가 코드> public var presentationContextProvider: Any?

if #available(iOS 13.0, *) { self.presentationContextProvider = DefaultPresentationContextProvider() } else { self.presentationContextProvider = nil }

마지막으로, 수정 후 다시 빌드해 주세요.

이 방법으로 하니 Xcode14 에서 오류없이 이용할수 있었습니다.

choiuhana commented 2 years ago

이 문제에 대한 해결된 버전을 업데이트 하실 계획이 있을까요?

ohing504 commented 1 year ago

저의 경우는 다음과 같이 해결하였습니다. (참고: Expo SDK 46, EAS 사용 중)

carda8 commented 1 year ago

혹시 KakaoSDKFriend 에서 Alamofire 를 못 찾는 에러는 안 나셨나요? pod 삭제 이후

아래 명령 Podfile 에 추가 target 'yourProjectName do pod 'Alamofire', '~> 5.5' ... 카카오 라이브러리 최신버전으로 수정후 Alamofire 의 버전을 올려주는 것으로 저는 해결하였습니다