当前位置:网站首页>Cososcreator upgrade gradle version
Cososcreator upgrade gradle version
2022-07-24 08:13:00 【sirria1】
In this paper, the reference :https://forum.cocos.org/t/topic/103837 ( Refer directly to this link for more details .)
- Cocos Creator 2.4.2
- Gradle 6.7.1( plug-in unit 4.2.1)
cocos Release native version , Do not add other package references , Generally, there is no need to upgrade gradle Of , But some channels sdk The package uses a more advanced version gradle The function of , Lead to our own engineering projects gradle Outdated Version , Have to upgrade compatibility .
step
1. The original version
Cocos Creator 2.4.2 packaged Android In Engineering gradle The version is 4.10.3( plug-in unit 3.2.0)
2. modify gradle Version number
use Android Studio open Cocos Creator Generated Android engineering , Point file ->Project Structure , stay Project Structure Select... In the panel Project. Enter directly on the right Gradle And the version number of the plug-in . after Android Studio I will download the corresponding version for myself .

3. modify setting.gradle To configure
File path :
jsb-default/frameworks/runtime-src/proj.android-studio/setting.gradle
Before the change :
include ':libcocos2dx',':game', ':instantapp'
After modification :
include ':libcocos2dx'
Reason for modification : Unwanted game, In less than This module is for Google Instant The use of , You can also directly shield the corresponding module .
4. modify CocosAndroid.mk
File path :
jsb-default/frameworks/runtime-src/proj.android-studio/jni/CocosAndroid.mk
Before the change :
LOCAL_MODULE := cocos2djs_shared
After modification :
LOCAL_MODULE := cocos2djs
Reason for modification :Android Studio Build It's a mistake , Can't find target “cocos2djs”
5. modify app/build.gradle
File path :
jsb-default/frameworks/runtime-src/proj.android-studio/app/build.gradle
Before the change :
android.applicationVariants.all { variant ->
// delete previous files first
delete "${buildDir}/intermediates/merged_assets/${variant.dirName}"
variant.mergeAssets.doLast {
def sourceDir = "${buildDir}/../../../../.."
copy {
from "${sourceDir}/assets"
into "${outputDir}/assets"
}
copy {
from "${sourceDir}/src"
into "${outputDir}/src"
}
copy {
from "${sourceDir}/jsb-adapter"
into "${outputDir}/jsb-adapter"
}
copy {
from "${sourceDir}/main.js"
from "${sourceDir}/project.json"
into outputDir
}
}
}
After modification :
android.applicationVariants.all { variant ->
// delete previous files first
delete "${buildDir}/intermediates/merged_assets/${variant.dirName}"
// modify Alarm error API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.It will be removed at the end of 2019.
// variant.mergeAssets.doLast {
variant.mergeAssetsProvider.get().doLast{
def sourceDir = "${buildDir}/../../../../.."
copy {
from "${sourceDir}/assets"
into "${outputDir}/assets"
into outputDir.dir("assets")
}
copy {
from "${sourceDir}/src"
into "${outputDir}/src"
into outputDir.dir("src")
}
copy {
from "${sourceDir}/jsb-adapter"
into "${outputDir}/jsb-adapter"
into outputDir.dir("jsb-adapter")
}
copy {
from "${sourceDir}/main.js"
from "${sourceDir}/project.json"
into outputDir
}
}
}
Reason for modification : Resource replication is missing . It's basically to put into "${outputDir}/x" Change to into outputDir.dir("x")
边栏推荐
- Use of ArrayList
- 图新地球:如何导入修改了高程基准(椭球)的CAD文件
- [linear algebra] deeply understand matrix multiplication, symmetric matrix, positive definite matrix
- 【线性代数】深入理解矩阵乘法、对称矩阵、正定矩阵
- A Knight‘s Journey题解
- Svg from entry to regret, why not learn it earlier (graphic version)
- how to add square on screenshot
- MySQL -- subquery scalar subquery
- WXS syntax reference -wxs module
- FPGA综合项目——图像边缘检测系统
猜你喜欢

Why is knowledge base important? This is the best answer I've ever heard

Figure New Earth: how the RVT format BIM model modeled by Revit can accurately match the map with texture

图新地球:Revit建模的rvt格式BIM模型如何带着纹理精准匹配地图
![[linear algebra] deeply understand matrix multiplication, symmetric matrix, positive definite matrix](/img/0f/4b7e92c61814b39e9b0448c0c854ee.png)
[linear algebra] deeply understand matrix multiplication, symmetric matrix, positive definite matrix
![[MySQL] installation tutorial and master-slave configuration](/img/79/0ad3f68b69a0a03a62422d4cc70035.png)
[MySQL] installation tutorial and master-slave configuration

*Project recurrence * project implementation of thesis based on contextbasedemotionrecognitionusingematicdataset

Opencv project - credit card recognition (learning record)

SVM linear separable linear support vector machine

RBM contrast divergence

【线性代数】深入理解矩阵乘法、对称矩阵、正定矩阵
随机推荐
SIFT feature point extraction
Recognition and storage of Graphs
[shutter] the shutter doctor reports an error
CNN-VINS
mysql使用explain分析sql执行计划帮助查找性能瓶颈
【游戏合集】手机都要被塞爆了,6款优质Pygame游戏合集降临~(附源码)
Robot operation continuous learning thesis (1) original text reading and Translation -- primitive generation strategy learning without catastrophic forgetting in robot operation
FPGA综合项目——图像边缘检测系统
图的认识与存储
UVA572油田 Oil Deposits题解
EZDML逆向工程导入数据库分析实操教程
Project practice - document scanning OCR recognition
Introduction of some functions or methods in DGL Library
P1739表达式括号匹配题解
Intelligent robot and intelligent system (Professor Zhengzheng of Dalian University of Technology) -- 5. Bionic robot
Svg from entry to regret, why not learn it earlier (graphic version)
Uva572 oil deposits problem solution
Kotlin coroutine (II): scope and cancellation
P1305新二叉树题解
A Knight‘s Journey题解