3.16 cocos compile last step fails

Hi, I just upgrade from 3.14.1 to 3.16, and the cocos compile cli for Android succeed but fails at the last step to move the apk. I tried on a new project, same error. The folder is fine, tried on few PC, same issue.

NDK16
Android Studio 3.0.1

Task :Test:assembleDebug
Skipping task ‘:Test:assembleDebug’ as it has no actions.

:Test:assembleDebug (Thread[Task worker for ‘:’,5,main]) completed. Took 0.0 secs.

BUILD SUCCESSFUL in 17s
54 actionable tasks: 2 executed, 52 up-to-date
Traceback (most recent call last):
File “D:\Library\cocos2d-x-3.16\tools\cocos2d-console\bin/cocos.py”, line 1072, in
run_plugin(command, argv, plugins)
File “D:\Library\cocos2d-x-3.16\tools\cocos2d-console\bin/cocos.py”, line 961, in run_plugin
plugin.run(argv, dependencies_objects)
File “D:\Library\cocos2d-x-3.16\tools\cocos2d-console\plugins\plugin_compile\project_compile.py”, line 1646, in run
self.build_android()
File “D:\Library\cocos2d-x-3.16\tools\cocos2d-console\plugins\plugin_compile\project_compile.py”, line 581, in build_android
self.apk_path = builder.do_build_apk(build_mode, self._no_apk, output_dir, self._custom_step_args, self._ap, self)
File “D:\Library\cocos2d-x-3.16\tools\cocos2d-console\plugins\plugin_compile\build_android.py”, line 669, 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: ‘C:\Temp\xxx\Test\proj.android-studio\app/build/outputs/apk\Test-debug.apk’

That’s not a problem.

The cli script just wanted to copy the apk into the build folder, but Google changed the directory. The path of your apk is probably in C:\Temp\xxx\Test\proj.android-studio\app/build/outputs/apk/debug\Test-debug.apk’.

You can copy the file directly from there.

@slackmoehrle Wouldn’t it be good to remove the CLI tools, because the will never be fixed because of the Android SDK changes?

They have been removed in GitHub v3 branch.

1 Like