Introduction
Recently, while packaging my iOS app with Xcode, I attempted to change the PRODUCT_NAME to a Korean string. However, after doing so, I encountered the error:
Missing or invalid signature. The bundle 'com.cheonhajeilart.kotfolio' at bundle path 'Payload/코트폴리오.app' is not signed using an Apple submission certificate.
In this post, I explain what PRODUCT_NAME is, why this error occurs when it contains non-ASCII characters, and what you can do to avoid the issue.
Understanding PRODUCT_NAME in Xcode Packaging
- PRODUCT_NAME is a key build setting in Xcode that defines the name of your app’s product.
- It is used in various critical places, such as:
- The bundle name (e.g., Payload/YourAppName.app)
- Code signing, where the bundle identifier and related metadata are embedded
- The Info.plist file and internal build processes
Why the Error Occurs
When PRODUCT_NAME is changed to a Korean string (or any non-ASCII text), several issues can arise:
- Code Signing and Bundle Identifier Problems:
- The PRODUCT_NAME is part of the app bundle's internal naming.
- Apple's code signing process and packaging tools expect these names to be in ASCII.
- Using non-ASCII characters can lead to mismatches or failures during the signature verification, resulting in errors like "Missing or invalid signature."
- Limitations of Internal Build Tools:
- Some of Apple's internal tools and signing processes are designed to work with ASCII characters.
- When non-ASCII characters (such as Korean) are used, these tools might not handle them properly, causing the signing process to fail.
What You Should Do Instead
- Keep PRODUCT_NAME in English (ASCII):
It is recommended to maintain PRODUCT_NAME using only English (or ASCII) characters to ensure proper functioning of the code signing and packaging process. - Set the Display Name Separately:
If you want your app to appear with a Korean name on the device, you can set the display name independently by modifying the CFBundleDisplayName key in the Info.plist file. This way, the internal bundle name remains compliant while the user-visible name can be in Korean.
My Custom Solution Using a User-Defined APP_
NAME Field
To work around this issue without sacrificing a localized display name, I did the following:
- Keep PRODUCT_NAME as an ASCII String:
I maintained the default PRODUCT_NAME in English (or any ASCII-compliant string) so that the internal bundle name and code signing remain unaffected. - Create a User-Defined Field (APP_NAME):
- In Xcode’s Build Settings, under the User-Defined section, I added a new field called APP_NAME.
- I set APP_NAME to my desired display name in Korean (or any localized string).
- Configure Info.plist to Use APP_NAME for Display:
- In the app’s Info.plist, I replaced the direct usage of the product name with the variable reference $(APP_NAME) for the CFBundleDisplayName key.
- This ensures that while the internal PRODUCT_NAME remains in ASCII, the user-visible app name appears in Korean.
Conclusion
Changing PRODUCT_NAME to include non-ASCII characters such as Korean can disrupt the Xcode packaging and code signing process, leading to errors like "Missing or invalid signature." The recommended approach is to keep PRODUCT_NAME as an ASCII string and manage the app's display name separately via the Info.plist file. This separation ensures that internal build processes remain stable while allowing for localized display names.
Happy coding!
'Flutter' 카테고리의 다른 글
Xcode Packaging에서 PRODUCT_NAME을 한글로 변경하면 서명 오류가 발생하는 이유 (1) | 2025.02.02 |
---|---|
Flutter App Bundle 빌드 중 R8 Missing Class Error 해결하기 (0) | 2025.02.02 |
Resolving R8 Missing Class Errors in Flutter App Bundle Build (1) | 2025.02.02 |
Flutter에서 Dependency Injection(DI)와 Service Locator를 활용한 의존성 관리 및 테스트 최적화 (1) | 2024.11.17 |
[Flutter] cached_network_image 알아보기 (2) | 2024.11.16 |