Android集成CocosCreator项目----详细记录

总共可分为三步

  • 新建Android空项目
  1. 打开AndroidStudio

  1. 选择空项目 ------- 》》next

 

  1. 自定义包名、路径,--------- 》》finish

  1. finish之后

  1. 项目目录结构

  • 新建CocosCreator项目
  1. 使用CocosCreator 创建项目并构建
  2. 使用AndroidStudio将构建的项目打成realease包

  • 把CocosCreator项目导入Android项目
  1. 解压realease包,提取.so文件(在lib目录下)和assets文件

  1. 拷贝lib、assets两个文件夹到安卓项目根目录,并将lib文件夹改成libs

  1. 拷贝CocosCreator  项目\native\engine\android 目录下的res文件夹到项目Android项目根目录

  1. 复制cocos文件,可以在CocosCreator项目gradle.properties中获取路径

COCOS_ENGINE_PATH=E:/CocosDashboard_1.2.2/resources/.editors/Creator/3.6.1/resources/resources/3d/engine/native

即 复制路径

E:/CocosDashboard_1.2.2/resources/.editors/Creator/3.6.1/resources/resources/3d/engine/native   下的cocos文件夹到安卓项目根目录下

  1. 同步文件 manifest文件(声明)、build.gradle(依赖)、proguard-rules.pro(混淆)、local.properties、settings.gradle、gradle.properties(配置)
  1. 修改local.gradle,设置sdk路径
  2. 修改settings.gradle,去掉蓝色框选内容,加上下面的内容

删除安卓项目app目录下的所有文件,从CocosCreator项目下拷贝app目录下的内容到安卓项目app目录下

  1. 修改manifest文件
  2. 修改proguard-rules.pro(混淆)

  1. 修改gradle.properties修改为以下内容

# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:

# Gradle settings configured through the IDE *will override*

# any settings specified in this file.

# For more details on how to configure your build environment visit

# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.

# The setting is particularly useful for tweaking memory settings.

org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.

# This option should only be used with decoupled projects. More details, visit

# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects

# org.gradle.parallel=true

# AndroidX package structure to make it clearer which packages are bundled with the

# Android operating system, and which are packaged with your app's APK

# https://developer.android.com/topic/libraries/support-library/androidx-rn

android.useAndroidX=true

# Enables namespacing of each library's R class so that its R class includes only the

# resources declared in the library itself and none from the library's dependencies,

# thereby reducing the size of the R class for that library

android.nonTransitiveRClass=true

# Android SDK version that will be used as the compile project

PROP_COMPILE_SDK_VERSION=32

# Android SDK version that will be used as the earliest version of android this application can run on

PROP_MIN_SDK_VERSION=21

# Android SDK version that will be used as the latest version of android this application has been tested on

PROP_TARGET_SDK_VERSION=32

# Android Build Tools version that will be used as the compile project

PROP_BUILD_TOOLS_VERSION=30.0.2

# Application ID

APPLICATION_ID=com.aduoliebaowjh.sqrkk

# List of CPU Archtexture to build that application with

# Available architextures (armeabi-v7a | arm64-v8a | x86 | x86_64)

# To build for multiple architexture, use the `:` between them

# Example - PROP_APP_ABI=arm64-v8a:armeabi-v7a

PROP_APP_ABI=arm64-v8a:armeabi-v7a

PROP_NDK_PATH=E:\\Sdk\\ndk\\25.0.8775105

# fill in sign information for release mode

RELEASE_STORE_FILE=E:/CocosDashboard_1.2.2/resources/.editors/Creator/3.3.2/resources/tools/keystore/debug.keystore

RELEASE_STORE_PASSWORD=123456

RELEASE_KEY_ALIAS=debug_keystore

RELEASE_KEY_PASSWORD=123456

有个别路径需自行匹配,对应的sdk工具版本可能也需要调整

  1. 修改build.gradle(依赖),安卓项目根目录下为以下内容

然后就可以愉快的进行下一步打包运行了!!!

还有不了解的老铁,请点击链接获取demo

https://download.csdn.net/download/apple_58054055/87221784

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
Cocos Creator是一款面向游戏开发者的跨平台游戏开发工具,它集成Cocos2d-x游戏引擎和Cocos Studio编辑器,支持多种平台上的游戏开发,如iOS、Android、Windows等。 消灭星星是一款基于Cocos Creator开发的游戏。在游戏中,玩家需要消除屏幕上的星星,以获得分数。游戏开始时,屏幕上会随机生成一些星星,玩家可以通过点击相连的星星来消除它们。消除的星星越多,得到的分数就越高。玩家可以通过不断消除星星来刷新高分记录,挑战自己的极限。 在消灭星星游戏中,Cocos Creator提供了丰富的功能和工具,为游戏开发者提供了便利。开发者可以使用Cocos Creator的图形界面编辑器来创建游戏场景、导入资源和设置游戏规则等。同时,Cocos Creator还提供了强大的脚本编写功能,开发者可以使用JavaScript或TypeScript编写游戏逻辑,实现游戏中的各种功能。 除了基本的消除星星玩法,Cocos Creator还支持添加特殊道具、关卡设计、人物角色等功能。开发者可以根据自己的需求,自定义游戏的玩法和功能,使游戏更加有趣和有挑战性。 总而言之,Cocos Creator游戏开发工具提供了强大的功能和便捷的开发环境,使开发者可以轻松地开发出各种各样的游戏,包括消灭星星这样的小而精致的休闲游戏。无论是想要学习游戏开发还是实现自己的游戏创意,Cocos Creator都是一个不错的选择。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爬山虎的博客

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值