Mobilefirst cli 构建失败:读取 info.plist 文件 1 字节 UTF-8
Mobilefirst cli build failed : reading info.plist file 1-byte UTF-8
我们有一个包含 iOS 和 android 本机环境的 mobilefirst 7.0 混合应用程序项目。
我们想在 windows 7 上使用 mobile first cli 7.0 来构建项目并在我们从 git 服务器检出该项目后生成构建时资源。
当它开始解析 iOS 项目的 info.plist 时失败。
下面的错误消息是我从 mfcli 得到的:
[Error:
BUILD FAILED
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:135: The following error occurred while executing this line:
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:341: The following error occurred while executing this line:
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:351: The following error occurred while executing this line:
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:330: Failed building application: com.worklight.builder.exception.WorklightBuildException: com.worklight.builder.exception.WorklightBuildRuntimeException: Resource Manager - Problem reading info.plist file 1-byte UTF-8 �ǦC���L�Ħ줸�� 1�C Nested exception: 1-byte UTF-8 �ǦC���L�Ħ줸�� 1�C
Total time: 18 seconds
]
"Resources Manager -Problem reading info.plist file 1-byte UTF-8"是什么意思?
我们在 windows 7 上的 git 本地存储库设置为 core.autocrlf = true。
info.plist 文件中有繁体中文字符,因此此问题可能与字符设置有关。
MFP CLI 不会更改文件的编码。
听起来像 Git 服务器 - 也许它托管在 Windows 上 - 确实影响了文件的编码。
文件应为 UTF-8。
使用.gitattributes
文件控制行尾(不要依赖core.autocrlf
)并显式排除 plist
和其他二进制文件从行结束转换。
例如:
* text=auto
*.plist binary
进一步调查后,我们发现这个问题肯定与mfcli有关。
也许 windows 上的 mfcli 不接受 Info.plist 中的非 ascii 代码字符。我们可以通过为 ios 项目中的 info.plist 文件应用本地化字符串来轻松解决此问题。
我们有一个包含 iOS 和 android 本机环境的 mobilefirst 7.0 混合应用程序项目。
我们想在 windows 7 上使用 mobile first cli 7.0 来构建项目并在我们从 git 服务器检出该项目后生成构建时资源。
当它开始解析 iOS 项目的 info.plist 时失败。
下面的错误消息是我从 mfcli 得到的:
[Error:
BUILD FAILED
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:135: The following error occurred while executing this line:
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:341: The following error occurred while executing this line:
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:351: The following error occurred while executing this line:
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:330: Failed building application: com.worklight.builder.exception.WorklightBuildException: com.worklight.builder.exception.WorklightBuildRuntimeException: Resource Manager - Problem reading info.plist file 1-byte UTF-8 �ǦC���L�Ħ줸�� 1�C Nested exception: 1-byte UTF-8 �ǦC���L�Ħ줸�� 1�C
Total time: 18 seconds
]
"Resources Manager -Problem reading info.plist file 1-byte UTF-8"是什么意思?
我们在 windows 7 上的 git 本地存储库设置为 core.autocrlf = true。
info.plist 文件中有繁体中文字符,因此此问题可能与字符设置有关。
MFP CLI 不会更改文件的编码。
听起来像 Git 服务器 - 也许它托管在 Windows 上 - 确实影响了文件的编码。
文件应为 UTF-8。
使用.gitattributes
文件控制行尾(不要依赖core.autocrlf
)并显式排除 plist
和其他二进制文件从行结束转换。
例如:
* text=auto
*.plist binary
进一步调查后,我们发现这个问题肯定与mfcli有关。
也许 windows 上的 mfcli 不接受 Info.plist 中的非 ascii 代码字符。我们可以通过为 ios 项目中的 info.plist 文件应用本地化字符串来轻松解决此问题。