首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >新项目为Android生成错误

新项目为Android生成错误
EN

Stack Overflow用户
提问于 2015-02-21 13:11:06
回答 2查看 638关注 0票数 0

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

代码语言:javascript
复制
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 (无此类文件或目录)嵌套异常:/User/raymondcamden/Desktop/trash/feb21/apps/App1/android/native/AndroidManifest.xml (没有这样的文件或目录)

经过多次重试,我只会在这方面出错。我可以确认这个文件确实不存在,但是我不知道为什么。

EN

回答 2

Stack Overflow用户

发布于 2015-02-23 09:55:38

如果您没有任何本机代码,那么删除环境- iPhone和android,然后再添加。我也有同样的问题,移除和添加环境就是其中的诀窍。

票数 0
EN

Stack Overflow用户

发布于 2015-03-04 16:14:10

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

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

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

代码语言:javascript
复制
$ 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值终止进程:

代码语言:javascript
复制
$ kill -9 70031

清除MFP测试服务器的临时目录:

代码语言:javascript
复制
$ rm -r $HOME/.ibm/mobilefirst

创建一个用于iOS和安卓的混合应用程序的新项目:

代码语言:javascript
复制
$ 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

希望这能有所帮助!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28646161

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档