mouseart
mouseart
采纳率0%
2017-11-27 08:32 阅读 1.5k

Android Studio debug cocos2d-x工程,成功编译后,报错无法进虚拟机

……以上编译内容省略
:AnimalPlanet:assembleDebug
Skipping task ':AnimalPlanet:assembleDebug' as it has no actions.
:AnimalPlanet:assembleDebug UP-TO-DATE
:AnimalPlanet:assembleDebug (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.001 secs.

BUILD SUCCESSFUL in 1s
51 actionable tasks: 1 executed, 50 up-to-date
Traceback (most recent call last):
  File "D:\environment\cocos2d-x-3.13.1\tools\cocos2d-console\bin\/cocos.py", line 998, in <module>
    run_plugin(command, argv, plugins)
  File "D:\environment\cocos2d-x-3.13.1\tools\cocos2d-console\bin\/cocos.py", line 916, in run_plugin
    plugin.run(argv, dependencies_objects)
  File "D:\environment\cocos2d-x-3.13.1\tools\cocos2d-console\plugins\plugin_compile\project_compile.py", line 1546, in run
    self.build_android()
  File "D:\environment\cocos2d-x-3.13.1\tools\cocos2d-console\plugins\plugin_compile\project_compile.py", line 527, in build_android
    self.apk_path = builder.do_build_apk(build_mode, self._no_apk, output_dir, self._custom_step_args, self)
  File "D:\environment\cocos2d-x-3.13.1\tools\cocos2d-console\plugins\plugin_compile\build_android.py", line 462, in do_build_apk
    shutil.copy(gen_apk_path, output_dir)
  File "C:\Python27\lib\shutil.py", line 119, in copy
    copyfile(src, dst)
  File "C:\Python27\lib\shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: 'D:\\work\\AnimalPlanet-_Iran\\proj.android-studio\\app/build/outputs/apk\\AnimalPlanet-debug.apk'

Process finished with exit code 1

如果单处APK没问题,但这样没法调试Java部分(sdk接入),着急啊,感谢有经营的大神指点。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • yan_jiankang yan_jiankang 2020-04-01 19:24

    android_build.py修改代码 565行开始,对照修改
    # copy the apk to output dir
    if output_dir:
    apk_name = '%s-%s.apk' % (project_name, build_mode)
    gen_apk_path = os.path.join(gen_apk_folder, build_mode)
    gen_apk_path = os.path.join(gen_apk_path, apk_name)
    if not os.path.exists(output_dir):

                                **_gen_apk_path = os.path.join(gen_apk_folder, build_mode)_**这一行就是添加了,原路径少了debug/release路径
    
    点赞 1 评论 复制链接分享
  • qq_40317838 努力努力更努力 2018-01-26 08:16

    查看一下你的java环境有没有问题 进入dos命令输入javac

    点赞 评论 复制链接分享

相关推荐