cocos creator2.3.2 打包Android问题记录

cocos creator2.3.2 打包Android问题记录--20204.13

运行环境:
Mac版本: 10.13.6
cocos creator 版本:2.3.2
AndroidSDK:在外置硬盘上

问题一、Android Studio编译失败提示"It is currently in use by another Gradle instance"异常处理

Task failed with an exception.
-----------
* What went wrong:
Could not create service of type TaskOutputFilesRepository using TaskExecutionServices.createTaskOutputFilesRepository().
> Timeout waiting to lock Build Output Cleanup Cache (***/frameworks/runtime-src/proj.android-studio/.gradle/buildOutputCleanup). It is currently in use by another Gradle instance.
  Owner PID: unknown
  Our PID: 758
  Owner Operation: unknown
  Our operation: 
  Lock file: ***/frameworks/runtime-src/proj.android-studio/.gradle/buildOutputCleanup/buildOutputCleanup.lock

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

解决方法:
在项目根目录,终端运行以下命令。

find ~/.gradle -type f -name "*.lock" | while read f; do rm $f; done

问题二GradleScopeCompileServices.createGeneralCompileCaches()

What went wrong:
Execution failed for task ':libcocos2dx:compileReleaseJavaWithJavac'.
> Could not create service of type DefaultGeneralCompileCaches using GradleScopeCompileServices.createGeneralCompileCaches().

终端进入项目的根目录,然后输入命令

./gradlew compileDebugJavaWithJavac --stacktrace

虽然没有改动什么,但在命令行执行这个命令后,在运行就不报错了

拓展:gradlew的功能。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容