0

We have a mobilefirst 7.0 hybrid application project that includes iOS and android native environment.
We want to use mobile first cli 7.0 on windows 7 to build project and generate build-time resources after we checkout this project from git server. And it fails when it began to parse info.plist of iOS project.
The error message below is what I got from 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
]

What does it mean "Resources Manager -Problem reading info.plist file 1-byte UTF-8"?

Our git local repository on windows 7 was set to core.autocrlf = true.
There are Traditional Chinese characters in info.plist file, therefore this issue could be related to character settings.

youjenlee
  • 69
  • 3
  • 9
  • I'm pretty sure this happens due to the way files are saved on this and how Git is parsing them and then how they are moved to Windows. Generally you shouldn't really mix and match Mac and Windows when you develop for iOS. Why would you? – Idan Adar Jul 28 '15 at 08:30
  • If you use the CLI in Mac, does it also fail this way? – Idan Adar Jul 28 '15 at 08:30
  • Parsing iOS project on windows with mfcli is not our purpose. We just want mfcli to generate android native project resources which was documented [not to commit to vcs](http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.1.0/com.ibm.worklight.dev.doc/devref/r_integrating_with_source_contro.html?lang=en) after checking the out from git. But It seems that mfcli does not have a switch to stop it from parsing the whole hybrid project on windows. – youjenlee Jul 29 '15 at 09:49
  • I am curious that whether mobilefirst hybrid project was designed to generate and configure native source project every time before the build process begins? As our point of view... the approach of prepare ,configure and commit these native source project to git, then checkout and build them on different os is much more reliable then preceding approach. That's why you saw that our hybrid project includes iOS native source project in this case. – youjenlee Jul 29 '15 at 09:49

3 Answers3

1

Use a .gitattributes file to control line endings (do not rely on core.autocrlf) and explicitly exclude plist and other binary files from line ending conversion.

For example:

* text=auto
*.plist binary
Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
  • Thank you ~ Let me try... By the way.... I have control line endings of git conversion by settings all files in iphone project should end with line feed (`/**/apps/**/iphone/native/* eol=lf`) in every os, but why doesn't it works? – youjenlee Jul 29 '15 at 10:05
  • After several test, I am sure that this approach can't fix our problem. But any way, thank you for your suggestion. I have already resolve it. – youjenlee Aug 05 '15 at 10:13
0

The MFP CLI does not change the encoding of files.

It sounds like the Git server - perhaps the fact that it is hosted on Windows - indeed affects the encoding of the files.

The files should be UTF-8.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • 2
    No, it doesn't change the encoding, but the CLI does mangle line endings on checkout. Servers don't do any of that or else you would destroy the commit hashes. – Edward Thomson Jul 28 '15 at 12:42
  • The MFP CLI is not doing any checkouts; I'm not clear about this comment by you. – Idan Adar Jul 28 '15 at 14:09
  • Apparently some confusion in the "CLI" terminology. You were talking about the MFP CLI, apparently? I was talking about the git CLI. – Edward Thomson Jul 28 '15 at 14:25
  • As a developer dealing with design flaws of worklight during past of a year,I was disappointed when I saw you blame on git at the first time you read this post. Apparently worklight team know little about git, a source control system takes more than 40% market shares. So far we've took much effort to make worklight tools work with git, but it seems that worklight does not take into account of the cooperation between it and git. I strongly advise your team to improve the design of worklight studio and it's build tools in recent patches. Btw.... our git server is hosted on Mac, not windows. – youjenlee Aug 05 '15 at 10:09
  • Thanks. If you have found a defect in the product I would more than encourage you to open a support ticket so the development team will correct it ASAP. – Idan Adar Aug 05 '15 at 10:11
0

After further more investigation, we found out that this issue is definitely related to mfcli.
Perhapes mfcli on windows does not accept non ascii code characters in Info.plist. We could fix this problem easily by applying Localized strings for info.plist file in ios project.

youjenlee
  • 69
  • 3
  • 9