Ibm mobilefirst 新项目生成Android时出错

Ibm mobilefirst 新项目生成Android时出错,ibm-mobilefirst,mobilefirst-cli,Ibm Mobilefirst,Mobilefirst Cli,我已经用MFP做了一些项目,但今天早上我创建了一个全新的项目: mfp create feb21 cd feb21 mfp add hybrid mfp add environment (selected iphone + android) mfp start 启动时,它运行了,但在iPhone区域失败: 构建失败 /Applications/IBM/MobileFirst CLI/MobileFirst CLI/node_modules/generator worklight server/

我已经用MFP做了一些项目,但今天早上我创建了一个全新的项目:

mfp create feb21
cd feb21
mfp add hybrid
mfp add environment (selected iphone + android)
mfp start
启动时,它运行了,但在iPhone区域失败:

构建失败 /Applications/IBM/MobileFirst CLI/MobileFirst CLI/node_modules/generator worklight server/lib/build.xml:128: 执行此行时发生以下错误: /Applications/IBM/MobileFirst CLI/MobileFirst CLI/node_modules/generator worklight server/lib/build.xml:305: 执行此行时发生以下错误: /Applications/IBM/MobileFirst CLI/MobileFirst CLI/node_modules/generator worklight server/lib/build.xml:315: 执行此行时发生以下错误: /Applications/IBM/MobileFirst CLI/MobileFirst CLI/node_modules/generator worklight server/lib/build.xml:294: 建筑应用程序失败: com.worklight.builder.exception.WorklightBuildException: com.worklight.builder.exception.WorklightBuildRuntimeException: 资源管理器-读取info.plist文件时出现问题 /用户/raymondcamden/Desktop/trash/feb21/apps/App1/iphone/native/authentications-Debug.plist 没有此类文件或目录嵌套异常: /用户/raymondcamden/Desktop/trash/feb21/apps/App1/iphone/native/authentications-Debug.plist 没有这样的文件或目录

然后我又试了一次,真见鬼,现在它在Android领域失败了:

构建失败 /Applications/IBM/MobileFirst CLI/MobileFirst CLI/node_modules/generator worklight server/lib/build.xml:128: 执行此行时发生以下错误: /Applications/IBM/MobileFirst CLI/MobileFirst CLI/node_modules/generator worklight server/lib/build.xml:305: 执行此行时发生以下错误: /Applications/IBM/MobileFirst CLI/MobileFirst CLI/node_modules/generator worklight server/lib/build.xml:315: 执行此行时发生以下错误: /Applications/IBM/MobileFirst CLI/MobileFirst CLI/node_modules/generator worklight server/lib/build.xml:294: 建筑应用程序失败: com.worklight.builder.exception.WorklightBuildException: com.worklight.builder.exception.WorklightBuildRuntimeException: 资源管理器-读取XML文件时出错: /Users/raymondcamden/Desktop/trash/feb21/apps/App1/android/native/AndroidManifest.xml 没有此类文件或目录嵌套异常: /Users/raymondcamden/Desktop/trash/feb21/apps/App1/android/native/AndroidManifest.xml 没有这样的文件或目录


在多次重试之后,我只在这个区域中得到错误。我可以确认文件确实不存在,但我不知道为什么。

如果您没有任何本机代码,请删除环境-iPhone和android,然后再次添加。我也遇到了同样的问题,删除和添加环境就成功了。

当未知发生时,最后的资源是清理mfp环境。 至少对于Mac,请尝试以下操作:

检查mfp测试服务器和分析服务是否正在运行并杀死它们。 一种方法是重新启动计算机

另一种方法是使用lsof查找进程ID PID:

$ lsof -i :10080
COMMAND   PID       USER   FD   TYPE 
java    70031 csantana23  171u  IPv4 0xc20be7c0903a7517      0t0  TCP *:10080 (LISTEN)
$lsof -i :10777
COMMAND   PID       USER   FD   TYPE
java    70031 csantana23    6u  IPv4 0xc20be7c0aee2c9f7      0t0  TCP *:10777 (LISTEN)
使用lsof输出的PID值终止进程:

$ kill -9 70031
清理MFP测试服务器的临时目录:

$ rm -r $HOME/.ibm/mobilefirst
使用iOS和Android混合应用程序创建新项目:

$ mfp create MFProject
A MobileFirst Project was successfully created at /Users/csantana23/MFProject
$ cd MFProject/
$ mfp add hybrid App1
A new Hybrid App was added at /Users/csantana23/MFProject/apps/App1
$ cd apps/App1/
$ mfp add environment iphone,android
A new android Environment was added at /Users/csantana23/MFProject/apps/App1/android
A new iphone Environment was added at /Users/csantana23/MFProject/apps/App1/iphone
$ mfp start
Cannot find the server configuration. Creating a new MobileFirst test server.
Initializing MobileFirst Console.
Starting server worklight.
Server worklight started with process ID 70325.
$ mfp preview

希望这有帮助

Ray您可以提供命令mfp info的输出,这将提供更多信息,例如JDK JAVA_HOME它应该是1.7。您还可以尝试删除App1/iphone/native和App1/android/native的本机目录。运行mfp构建,但这次是在调试模式下运行,以便打印更多信息。mfp构建-dmfp信息在这里:哦,在完成之前发送了注释。删除了本机文件夹,这里是mfp build-d的输出:仅供参考,我做了另一个项目,执行了与上面完全相同的命令行调用,我更改了名称,得到了相同的错误。我是否在这里错误地使用了CLI?我的想法是:新项目。混合的我想支持iOS+Android。这是通过CLI实现的吗?我没有看到这样的命令。另外,上面Carlos建议删除本机文件夹,我这样做了,但没有成功。通过cli完成。若要删除环境,请参阅以下答案:。它基本上只是删除本机文件夹,但这对我来说很有效。这让我可以构建。不过,我要尝试另一个处女项目。这与我有关。