Precautions for CocosIDE exporting Android APK

Source: Internet
Author: User

Precautions for CocosIDE exporting Android APK

Recently, CocosIDE is being used to develop new games, and the overall experience is quite good. Supports breakpoint debugging and real-machine debugging. Variable information during debugging is also richer than that of many lua plug-ins in vs, and it is more convenient to use than some specialized lua debugging tools. In addition, some syntax errors are available, and some low-level errors can be checked in advance. A bit uncomfortable: The Code Completion response is slow and slow, and most of the time it cannot be compared with VA when the smart prompts are completed.

I encountered some difficulties when using CocosIDE to export the Android APK.

1. When using IDE Export (right-click to select Cocos Tools --- Public Package), an error is always prompted and the android-19 sdk cannot be found, which does exist.

2. Use the command line of cocos2d-console (under the tools folder of the Engine Directory) to export, this is OK, but you need to configure a lot of things.

The setup. py in the running Engine Directory can automatically add some environment variables, but some of them do not exist. If you encounter any errors, you can check them by yourself.


Which of the following must be added to the environment variable Path:

(Android SDK directory)

E: \ MyProj \ adt-bundle-windows-x86 \ sdk \ platform-tools;
E: \ MyProj \ adt-bundle-windows-x86 \ sdk \ tools;

(Python directory)
C: \ Python27;

(ANT directory for automatic packaging)
E: \ MyProj \ apache-ant-1.9.4 \ bin;

(NDK directory)
E: \ MyProj \ android-ndk-r9d;

(Java Runtime Environment directory)
C: \ Program Files (x86) \ Java \ jre8 \ bin

(The directory where the cocos command is located. run setup. py to automatically add it)
E: \ MyProj \ cocos2d-x-3.3beta0 \ tools \ cocos2d-console \ bin


Other environment variables (in the environment variable configuration, create items such as ANDROID_SDK_ROOT, and then the value is E: \ MyProj \ adt-bundle-windows-x86 \ sdk ):

ANDROID_SDK_ROOT = E: \ MyProj \ adt-bundle-windows-x86 \ sdk
ANT_ROOT = E: \ MyProj \ apache-ant-1.9.4
COCOS_CONSOLE_ROOT = E: \ MyProj \ cocos2d-x-3.3beta0 \ tools \ cocos2d-console \ bin
NDK_ROOT = E: \ MyProj \ android-ndk-r9d

You can run

Cocos run-p android or cocos deploy-p android to run or publish an apk.

For specific cocos parameters, enter cocos -- help or view README in the Engine Directory.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.