[英]Why I can't set android-platform lower then 22 when I compile?
When I compile standard hello world project, created by cocos-console ( cocos2d-x 3.6
) with --ap android-16
(android platform 16) it wrights: 当我用
--ap android-16
(android platform 16)编译由cocos-console( cocos2d-x 3.6
)创建的标准hello world项目时,它会出错:
The android-platform of project "E:\projects\cocos_projects\test\proj.android" s
hould be equal/larger than 22, but 16 is specified.
In AndroidManifest.xml I have: <uses-sdk android:minSdkVersion="9"/>
. 在AndroidManifest.xml中,我具有:
<uses-sdk android:minSdkVersion="9"/>
。
In SDK manager I have installed all platforms and at ...\\sdk\\platforms
I have 8, 10, 15-22 and MNC folders. 在SDK Manager中,我已经安装了所有平台,并且在
...\\sdk\\platforms
我有8、10、15-22和MNC文件夹。
@Andrey answer is basically right, but I'll complete it with some missing information for the sake of any other cocos2d-x developers looking for how to solve this. @Andrey的答案基本上是正确的,但是为了让其他任何cocos2d-x开发人员寻求解决方法,我将使用一些缺少的信息来完成它。
This error: 这个错误:
The android-platform of project "E:\\projects\\cocos_projects\\test\\proj.android" should be equal/larger than 22, but 16 is specified.
项目“ E:\\ projects \\ cocos_projects \\ test \\ proj.android”的android平台应等于/大于22,但指定为16。
appears when you tell to the cocos
command to use an Android API version ( --ap android-XX
) which conflicts with your project properties
configuration. 当您告诉
cocos
命令使用与project properties
配置冲突的Android API版本( --ap android-XX
)时,会出现。
Let's say your proj.android/project.properties
is something like this: 假设您的
proj.android/project.properties
是这样的:
target=android-22
android.library.reference.1=../cocos2d/cocos/platform/android/java
So, before launching a command that request to use a different Android API version (ex. cocos compile -p android --ap android-16
), you should manually edit project.properties
and changed the target
key to a value that matches the new Android API version you want to use. 因此,在启动请求使用其他Android API版本的命令(例如
cocos compile -p android --ap android-16
)之前,您应该手动编辑project.properties
并将target
密钥更改为与新密钥匹配的值您要使用的Android API版本。
当我修改...\\proj.android\\project.properties
它起作用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.