Considerations for cocos2dx3. X Project rewriting (additional article) 3.x APK Packaging

Source: Internet
Author: User

3. x packaging APK is relatively convenient.

First, you must configure the environment for Android and Java. Let me talk about a few things that are easy to ignore.

The proj. Android/JNI/Android. mk file must be modified.

Under normal circumstances, you only need to add your own classes as follows:

LOCAL_SRC_FILES := hellocpp/main.cpp                    ../../Classes/AppDelegate.cpp                    ../../Classes/Stage.cpp            ../../Classes/player.cpp
It should be noted that if we use the extension library, such as the controlbutton callback, we need to add the following replacement in Android. mk. We can find that the developer has already added the extension in the MK file.

LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static

# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static

# $(call import-module,extensions)
In the MK file, the well number is a comment. We need to remove the last two annotations to activate these two references. You only need to remove the well number. (When writing # include "extensions/cocos-ext.h", to write full, avoid not found)

In the main directory of the project, you can use the Cocos compile-P Android -- AP 20 command to package it.

The generated APK is in the publish file.

For Java and Android environment configuration, see the official website ~




Considerations for cocos2dx3. X Project rewriting (additional article) 3.x APK Packaging

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.