[Flutter] ios 구글 로그인 (Info.plist)

Comely·2025년 2월 17일

Flutter

목록 보기
26/26

오류

flutter:[signInWithGoogle] 알 수 없는 오류 발생: PlatformException(google_sign_in, Your app is missing support for the following URL schemes: com.googleusercontent.apps.883859608601-mmdhmi1vsbbqfm1, NSInvalidArgumentException, null)

오류 메시지를 보면 앱이 GoogleSignIn을 위한 URL Scheme을 지원하지 않아서 발생하는 문제입니다.
해결하려면 Info.plist에 올바른 URL Scheme을 추가해야 합니다.

해결 방법: Info.plist 수정하기

Xcode에서 ios/Runner/Info.plist를 엽니다.
아래 내용을 추가합니다.
"YOUR_REVERSED_CLIENT_ID" 부분을 GoogleService-Info.plist에서 확인한 값으로 변경합니다.

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>YOUR_REVERSED_CLIENT_ID</string>
        </array>
    </dict>
</array>

YOUR_REVERSED_CLIENT_ID 값 확인하는 방법

ios/Runner/GoogleService-Info.plist 파일을 열고,
REVERSED_CLIENT_ID 값을 확인합니다.

<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.883859608601-mmdhmi1d41ea3vr3h6p72abvvsbbqfm1</string>

위의 예제에서 "com.googleusercontent.apps.883859608601-mmdhmi16p72abvvsbbqfm1" 값을 Info.plist에 추가해야 합니다.

✅ 최종 Info.plist 예제

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>com.googleusercontent.apps.883859608601-mmdhmi1d2abvvsbbqfm1</string>
        </array>
    </dict>
</array>
profile
App, Web Developer

0개의 댓글