开发工具
1. Cocos Creator 2.4.0
2. Android Studio 3.6.3
gradle 版本
原:4.10.3(插件3.2.0)
新:5.6.4(插件3.6.3)
错误解决
1. jsb-default/frameworks/runtime-src/proj.android-studio/setting.gradle(构建失败)
修改前:
include ':libcocos2dx',':game'
修改后:
include ':libcocos2dx'
解释:不需要game,用不到,构建出错
2. jsb-default/frameworks/runtime-src/proj.android-studio/jni/CocosAndroid.mk
修改前:
LOCAL_MODULE := cocos2djs_shared
修改后:
LOCAL_MODULE := cocos2djs
解释:构建成功运行apk报错,找不到“libcocos2djs.so“,官方提供的解决方案
3. jsb-default/frameworks/runtime-src/proj.android-studio/app/build.gradle(资源丢失)
修改前:
copy {
from "${sourceDir}/assets"
into "${outputDir}/assets"
}
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}/src"
into "${outputDir}/src"
}
copy {
from "${sourceDir}/jsb-adapter"
into "${outputDir}/jsb-adapter"
}
修改后:
copy {
from "${sourceDir}"
include "assets/**"
include "res/**"
include "src/**"
include "jsb-adapter/**"
into outputDir
}
解释:更新后继续使用原有方式,assets等文件夹无法拷贝过去
作者:居安up
链接:https://www.jianshu.com/p/866f2798b98c
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。