Cocos Engine v2.1 version Android compilation problem Resolution (COCOS2D-X-3.4RC1)

Source: Internet
Author: User

Download the latest version of the Cocos V2.1.2beta, using Cocos.exe to create the project, and in the bottom of the attachment feature also checked the "Support x86 architecture CPU" option, resulting in the use of build_ native.py compilation does not pass, and cocos.py also compile not pass; hint android.mk 19 rows PREBUILT-MK Error: ***android NDK aborting,

After trying to make a few changes--add the NDK_MODULE_PATH environment variable, the use of the NDK version downloaded from Cocos \ See the explanation of others on the Internet, PREBULT-MK error is because this path under the link is not the cocosframework I installed on the C drive, So according to other people said copy C:\Cocos\frameworks\cocos2d-x-3.4rc1 This directory to my own project root directory, and renamed to COCOS2D,ANDROID.MK add $ (call Import-add-path, $ (Local_path)/.. /.. /COCOS2D)
$ (call import-add-path,$ (Local_path)/. /.. /cocos2d/external)
$ (call import-add-path,$ (Local_path)/. /.. /cocos2d/cocos), there is still a problem, perhaps these changes make cocos.py compile can pass, see the build success and other hints, but still cannot compile the apk in eclipse or use cocos.py You can run out of the APK but it won't work again, try again, think of the way to create a project in the 2.x era, then use cocos.py's new command to create the project, incredibly successful, and not only using cocos.py compile success, Direct eclipse automatically uses build_native.py to compile libcocos2dcpp.so This dynamic library file when clean, seemingly because the latest ndk is used to cause this (anyway, Cygwin can be uninstalled completely); I'm not reconciled. , again using the Cocos.exe to create the project (do not check the support x86 architecture CPU), but also successfully run, but I feel the brain is confused, should have such a operation before how is not the right now again? The point is that the cocos.py new command has been used to do something cocos.exe create the project, so that the next project created with Cocos.exe is OK? It also shows that there is no need to copy the COCOS2D framework to your project or add $ (call import-add-path,$ (Local_path)/. /.. /COCOS2D) These three lines, the default creation of the project can be read to the framework path; Well, too lazy to clarify the reason for the mistake before, can run up can, the process recorded, finally can open happy heart of the project.Win7 under Cocos v2.1 Android project summary: 1,cocosv2.1 download installation,  2,java SDK download installation, new environment variable Java_home:c:\program files\java\jdk1.8.0_31, new environment variable classpath:.;  %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;  Find the path variable, add:%java_home%;  in the cmd terminal input java-version return to see similar 1.8.0_31 instructions JAVA environment OK  3,android SDK, In the Baidu network disk downloaded to include all the latest Android version of the Adt-bundle-windows-x86_64-20140702.zip, there is 8.59G, you can also download an empty ADT bundle and then open the SDK Manager to choose to download the Android SDK you need, but remember to change the download server path Select Domestic, Google can not link the new environment variables you understand android_sdk:e:\adt-bundle-windows-x86_ 64-20140702\sdk\platforms; E:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools;  E:\adt-bundle-windows-x86_64-20140702\sdk\tools; New environment variable ANDROID_SDK_ROOT:E:\ADT-BUNDLE-WINDOWS-X86_64-20140702\SDK find path variable, new:%android_sdk%;  in cmd terminal input adb- H See Android Debug Bridge version 1.0.32 similar statements stating the Android SDK environment OK.   4,android NDK, the new environment variable ndk_root:e:\android-ndk-r10d is android-ndk-r10d when the current version is downloaded directly from the Cocos store; new environment variable NDK_MODULE_PATH:C:\COCOS\FRAMEWORKS\COCOS2D-X-3.4RC1; C:\Cocos\frameworks\cocos2d-x-3.4rc1\external; C:\Cocos\frameworks\cocos2d-x-3.4rc1\cocos;  Finally, use Cocos.exe to create the project, if your Android phone CPU is not x86 architecture then do not tick "support x86 architecture CPU" below, if there is a problem, You can try using cocos.py to start a new project, and vs2013 can open eclipse to debug Android after running without problems. In fact cocos.py run can directly compile out the APK file and run on the connected phone.  

Cocos Engine v2.1 version Android compilation problem Resolution (COCOS2D-X-3.4RC1)

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.