2015-07-28 41 views
0

我們有一個包含iOS和Android本地環境的mobilefirst 7.0混合應用程序項目。
我們希望在Windows 7上使用移動的第一個cli 7.0來構建項目並在我們從git服務器檢出此項目後生成構建時資源。 它開始解析iOS項目的info.plist時失敗。
下面的錯誤消息是我從mfcli有:Mobilefirst cli構建失敗:閱讀info.plist文件1字節UTF-8

[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 
] 

是什麼意思「資源管理器 - 問題閱讀Info.plist文件1個字節的UTF-8」?

我們在windows 7上的git local repository被設置爲core.autocrlf = true。
info.plist文件中有繁體中文字符,因此這個問題可能與字符設置有關。

+0

我敢肯定,這是由於文件保存的方式以及Git如何解析它們以及它們如何移動到Windows。一般來說,當您爲iOS開發時,您不應該混合搭配Mac和Windows。你爲什麼? –

+0

如果您在Mac中使用CLI,它是否也以這種方式失敗? –

+0

使用mfcli在windows上解析iOS項目不是我們的目的。 我們只是希望m​​fcli生成已記錄的android原生項目資源[不要提交給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)在檢查完git之後。 但似乎mfcli沒有一個開關來阻止它在windows上解析整個混合項目。 – youjenlee

回答

0

經過進一步調查,我們發現,這個問題肯定是關係到mfcli。
Windows上的Perhapes mfcli不接受Info.plist中的非ASCII代碼字符。我們可以通過在ios項目中爲info.plist文件應用Localized字符串來輕鬆解決這個問題。

0

MFP CLI不更改文件的編碼。

聽起來像Git服務器 - 可能是它託管在Windows上的事實 - 的確會影響文件的編碼。

這些文件應該是UTF-8。

+2

不,它不會更改編碼,但CLI在結帳時不會改變行結尾。服務器不執行任何操作,否則會破壞提交散列。 –

+0

MFP CLI沒有執行任何結賬;我不清楚你的評論。 –

+0

「CLI」術語中顯然存在一些混淆。你在談論MFP CLI,顯然?我在談論git CLI。 –

1

使用.gitattributes文件來控制行結束符(不依賴core.autocrlf),並明確排除plist和其他二進制從行尾轉換文件。

例如:

* text=auto 
*.plist binary 
+0

謝謝〜讓我試試... 順便說一下....我有控制線結束git轉換的設置iphone項目中的所有文件應以換行符結束('/ **/apps/**/iphone/native/* eol = lf'),但它爲什麼不起作用? – youjenlee

+0

經過多次測試,我確信這種方法不能解決我們的問題。 但任何方式,謝謝你的建議。我已經解決了它。 – youjenlee