crossplatformkorea / react-native-kakao-login

react-native native module for Kakao sign in.
MIT License
350 stars 133 forks source link

iOS 대상으로 eas build 시 빌드에 실패하는 상황에 대해 도움이 필요합니다! #367

Closed sanspareilsmyn closed 1 year ago

sanspareilsmyn commented 1 year ago

Description

안녕하세요. eas-cli를 통해 ios 빌드 시 문제가 발생하여 이것저것 시도를 해 보았는데 해결이 안 되어 도움을 요청드리고자 이슈를 남깁니다. 진행한 과정의 상세한 내용은 아래의 Steps to reproduce에 작성하였습니다. eas build --platform ios --profile development 커맨드 실행 시 Run fastlane 스텝에서 아래와 같은 에러 때문에 빌드에 지속적으로 실패하는 현상입니다.

› Executing app » [CP] Check Pods Manifest.lock
› Executing app » Start Packager on http://localhost:8081
› Copying   ios/app/GoogleService-Info.plist ➜ ./GoogleService-Info.plist
› Copying   ios/app/Supporting/Expo.plist ➜ ./Expo.plist
› Compiling app » SplashScreen.storyboard
› Preparing app » Info.plist
› Compiling app » noop-file.swift
› Compiling app » ExpoModulesProvider.swift
› Compiling app » main.m
› Compiling app » app_vers.c
› Compiling app » AppDelegate.mm

❌  (/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:9:1)

   7 | //
   8 | 
>  9 | @class RNKakaoLogins;
     | ^ unexpected '@' in program
  10 | 
  11 | @interface RNKakaoLogins : NSObject
  12 | - (RNKakaoLogins *)returnSwiftClassInstance;

❌  (/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:11:1)

   9 | @class RNKakaoLogins;
  10 | 
> 11 | @interface RNKakaoLogins : NSObject
     | ^ unexpected '@' in program
  12 | - (RNKakaoLogins *)returnSwiftClassInstance;
  13 | + (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
  14 | + (BOOL)handleOpenUrl:(NSURL *)url;

❌  (/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:13:28)

  11 | @interface RNKakaoLogins : NSObject
  12 | - (RNKakaoLogins *)returnSwiftClassInstance;
> 13 | + (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
     |                            ^ expected ';' after expression
  14 | + (BOOL)handleOpenUrl:(NSURL *)url;
  15 | @end
  16 | 

❌  (/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:13:9)

  11 | @interface RNKakaoLogins : NSObject
  12 | - (RNKakaoLogins *)returnSwiftClassInstance;
> 13 | + (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
     |         ^ use of undeclared identifier 'isKakaoTalkLoginUrl'
  14 | + (BOOL)handleOpenUrl:(NSURL *)url;
  15 | @end
  16 | 

❌  (/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:13:38)

  11 | @interface RNKakaoLogins : NSObject
  12 | - (RNKakaoLogins *)returnSwiftClassInstance;
> 13 | + (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
     |                                      ^ use of undeclared identifier 'url'
  14 | + (BOOL)handleOpenUrl:(NSURL *)url;
  15 | @end
  16 | 

❌  (/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:14:22)

  12 | - (RNKakaoLogins *)returnSwiftClassInstance;
  13 | + (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
> 14 | + (BOOL)handleOpenUrl:(NSURL *)url;
     |                      ^ expected ';' after expression
  15 | @end
  16 | 

❌  (/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:14:9)

  12 | - (RNKakaoLogins *)returnSwiftClassInstance;
  13 | + (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
> 14 | + (BOOL)handleOpenUrl:(NSURL *)url;
     |         ^ use of undeclared identifier 'handleOpenUrl'
  15 | @end
  16 | 

❌  (/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:14:32)

  12 | - (RNKakaoLogins *)returnSwiftClassInstance;
  13 | + (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
> 14 | + (BOOL)handleOpenUrl:(NSURL *)url;
     |                                ^ use of undeclared identifier 'url'
  15 | @end
  16 | 

❌  (/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:15:1)

  13 | + (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
  14 | + (BOOL)handleOpenUrl:(NSURL *)url;
> 15 | @end
     | ^ unexpected '@' in program
  16 | 

❌  (/Users/expo/workingdir/build/ios/app/AppDelegate.mm:47:11)

  45 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
  46 |       if([RNKakaoLogins isKakaoTalkLoginUrl:url]) {
> 47 |   return [RNKakaoLogins handleOpenUrl: url];
     |           ^ use of undeclared identifier 'RNKakaoLogins'
  48 | }
  49 |   return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];
  50 | }

Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'fmt' from project 'Pods')
    Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Libuv-gRPC' from project 'Pods')
    Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'BoringSSL-GRPC' from project 'Pods')
    Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RCT-Folly' from project 'Pods')
    Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-Codegen' from project 'Pods')
    Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
    Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'gRPC-Core' from project 'Pods')
 Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'gRPC-C++' from project 'Pods')
▸ ** ARCHIVE FAILED **
▸ The following build commands failed:
▸   CompileC /Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/app.build/Debug-iphoneos/app.build/Objects-normal/arm64/AppDelegate.o /Users/expo/workingdir/build/ios/app/AppDelegate.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'app' from project 'app')
▸ (1 failure)
** ARCHIVE FAILED **
The following build commands failed:
    CompileC /Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/app.build/Debug-iphoneos/app.build/Objects-normal/arm64/AppDelegate.o /Users/expo/workingdir/build/ios/app/AppDelegate.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'app' from project 'app')
(1 failure)
Exit status: 65
+-------------+-------------------------+
|           Build environment           |
+-------------+-------------------------+
| xcode_path  | /Applications/Xcode.app |
| gym_version | 2.211.0                 |
| sdk         | iPhoneOS16.2.sdk        |
+-------------+-------------------------+
Looks like fastlane ran into a build/archive error with your project
It's hard to tell what's causing the error, so we wrote some guides on how
to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
Before submitting an issue on GitHub, please follow the guide above and make
sure your project is set up correctly.
fastlane uses `xcodebuild` commands to generate your binary, you can see the
the full commands printed out in yellow in the above log.
Make sure to inspect the output above, as usually you'll find more error information there
[!] Error building the application - see the log above
Error: The "Run fastlane" step failed with an unknown error. Refer to "Xcode Logs" below for additional, more detailed logs.

Xcode Logs에서 에러가 발생한 마지막 부분은 아래와 같습니다.

In file included from /Users/expo/workingdir/build/ios/app/AppDelegate.mm:26:
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:9:1: error: unexpected '@' in program
@class RNKakaoLogins;
^
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:11:1: error: unexpected '@' in program
@interface RNKakaoLogins : NSObject
^
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:13:28: error: expected ';' after expression
+ (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
                           ^
                           ;
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:13:9: error: use of undeclared identifier 'isKakaoTalkLoginUrl'
+ (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
        ^
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:13:38: error: use of undeclared identifier 'url'
+ (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
                                     ^
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:14:22: error: expected ';' after expression
+ (BOOL)handleOpenUrl:(NSURL *)url;
                     ^
                     ;
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:14:9: error: use of undeclared identifier 'handleOpenUrl'
+ (BOOL)handleOpenUrl:(NSURL *)url;
        ^
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:14:32: error: use of undeclared identifier 'url'
+ (BOOL)handleOpenUrl:(NSURL *)url;
                               ^
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:15:1: error: unexpected '@' in program
@end
^
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:13:1: warning: expression result unused [-Wunused-value]
+ (BOOL)isKakaoTalkLoginUrl:(NSURL *)url;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/expo/Library/Developer/Xcode/DerivedData/app-gfczuwoxhhirjpelxqecjxyrawps/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Debug-iphoneos/kakao-login/kakao_login.framework/Headers/RNKakaoLogins.h:14:1: warning: expression result unused [-Wunused-value]
+ (BOOL)handleOpenUrl:(NSURL *)url;
^ ~~~~~~~~~~~~~~~~~~~
/Users/expo/workingdir/build/ios/app/AppDelegate.mm:46:11: error: use of undeclared identifier 'RNKakaoLogins'
      if([RNKakaoLogins isKakaoTalkLoginUrl:url]) {
          ^
/Users/expo/workingdir/build/ios/app/AppDelegate.mm:47:11: error: use of undeclared identifier 'RNKakaoLogins'
  return [RNKakaoLogins handleOpenUrl: url];
          ^
15 warnings and 11 errors generated.

warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'fmt' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Libuv-gRPC' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'BoringSSL-GRPC' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RCT-Folly' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-Codegen' from project 'Pods')
warning: Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'gRPC-Core' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'gRPC-C++' from project 'Pods')

Steps to reproduce

  1. yarn add @react-native-seoul/kakao-login 실행
  2. app.json에 아래와 같이 추가
    "plugins": [
      ...
      [
        "@react-native-seoul/kakao-login",
        {
          "kakaoAppKey": "${카카오 네이티브 앱 키}"
        }
      ]
      ...
    ]
  3. expo prebuild 커맨드 실행
  4. eas build --platform ios --profile development 실행

Snack or a link to a repository

https://github.com/sanspareilsmyn/lettre-v2

React Native Kakao Login version

5.2.6

React Native version

0.71.3

Platforms

iOS

JavaScript runtime

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Benj846 commented 1 year ago

저도같은 증상으로 며칠째 머리아파하고있는데요 ㅠ 어떻게 해결하셨어요?

sanspareilsmyn commented 1 year ago

@Benj846 해결 못 해서 webview로 구현했습니다

YeonjuChoi commented 1 year ago

저도 동일한 오류를 겪다가 AppDelegate.mm 에서 #import <RNKakaoLogins.h>를 파일 상단에 이동시키고 빌드 돌리니 해결되긴 했습니다!

스크린샷 2023-04-04 오후 2 30 35
Benj846 commented 1 year ago

저도 동일한 오류를 겪다가 AppDelegate.mm 에서 #import <RNKakaoLogins.h>를 파일 상단에 이동시키고 빌드 돌리니 해결되긴 했습니다! 스크린샷 2023-04-04 오후 2 30 35

eas build --local사용하셨나요? 저도 동일하게 했는데 안되더라고요 eas build profile 공유 부탁드려도 될까요?

eas 안쓰고 xcode 빌드 할때는 문제없이 되긴하는데 eas 로 해결하고싶네요 ㅠ

kkiriky commented 1 year ago

저도 동일한 오류를 겪다가 AppDelegate.mm 에서 #import <RNKakaoLogins.h>를 파일 상단에 이동시키고 빌드 돌리니 해결되긴 했습니다! 스크린샷 2023-04-04 오후 2 30 35

eas build --local사용하셨나요? 저도 동일하게 했는데 안되더라고요 eas build profile 공유 부탁드려도 될까요?

eas 안쓰고 xcode 빌드 할때는 문제없이 되긴하는데 eas 로 해결하고싶네요 ㅠ

https://github.com/crossplatformkorea/react-native-kakao-login/issues/326#issuecomment-1326594581

저는 위 링크를 참고했습니다.

  1. overrideKakaoSDKVersion: '2.11.1' 으로 버전 변경 (SDK 버전에 따라 kotlinVersion: '1.5.20' 이상으로 변경해야 할 수도 있습니다.)
  2. npx expo prebuild --clean
  3. cd ios && pod update KakaoSDKAuth KakaoSDKCommon KakaoSDKUser
  4. AppDelegate.mm의 #import 의 위치를 상단으로 이동
  5. eas build --profile development --platform ios