Cocos 新建项目 以及编译流程

Cocos 新建项目

cocos new gong2 -p com.gamejelly.gong2 -l lua -d /Users/wangchengcheng/Documents/SelfZone/Cocos

cocos new MyGame -p com.wacenn.mygame -l lua -d /Users/wangchengcheng/Documents/SelfZone/Cocos 

cocos new GameTest -p com.wacenn.gametest -l lua -d /Users/wangchengcheng/Documents/SelfZone/Cocos

new:new后是项目名 

-p :-p后是包名 

-l :-l后是语言(cpp指c++) 

-d :-d后是项目生成路径

客户端要做:

登录,热更新,资源加载,战斗,地图拖动,充值,自己实现

打包

 cocos compile -p android -m release --android-studio

编译模式:release

使用 Android Studio 工程:/Users/wangchengcheng/Documents/GameJelly2/gong2client/trunk/gong2/frameworks/runtime-src/proj.android-studio

正在生成 apk 文件...

请输入 '.keystore' 文件的绝对路径(相对路径):

/Users/wangchengcheng/Documents/GameJelly2/gong2client/trunk/gong2/frameworks/runtime-src/proj_gong2.android-studio/android.keystore 

请输入签名文件的别名:

android

请输入签名文件的密码:

gamejelly123

请输入别名的密码:

gamejelly123

gradle 的问题

用命令build app时出现这个错误。

Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: /Users/weidingqiang/.gradle/wrapper/dists/gradle-2.4-all/3i2gobhdl0fm2tosnn15g540i0/gradle-2.4-all.zip

at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:61)

at org.gradle.wrapper.Install.createDist(Install.java:47)

at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)

at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)

解决方法

1.删除/Users/weidingqiang/.gradle/wrapper/dists/gradle-2.4-all  

2.重新下载gradle-2.4-all.zip,放到/Users/weidingqiang/.gradle/wrapper/dists/gradle-2.4-all/3i2gobhdl0fm2tosnn15g540i0/ 目录下

即可

人的一生能做好一件事就阿弥陀佛了

原文地址:https://www.cnblogs.com/cci8go/p/7991481.html