我已经用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文件 /Users/raymondcamden/Desktop/trash/feb21/apps/App1/iphone/native/Entitlements-Debug.plist (没有这样的文件或目录)嵌套异常: /Users/raymondcamden/Desktop/trash/feb21/apps/App1/iphone/native/Entitlements-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 (没有这样的文件或目录)
多次重试后,我只会在这方面遇到错误。我可以确认该文件确实不存在,但我不知道为什么。
答案 0 :(得分:0)
如果您没有任何本机代码,请删除环境 - iPhone和Android,然后重新添加。我有同样的问题,删除和添加环境就可以了。
答案 1 :(得分:0)
当未知发生时,最后的资源是清理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
希望这有帮助!