为什么我在编译时不能将 android 平台设置为低于 22?

Why I can't set android-platform lower then 22 when I compile?

本文关键字:设置 平台 android 编译 不能 为什么      更新时间:2023-10-16

当我编译由cocos控制台(cocos2d-x 3.6)和--ap android-16(android平台16)创建的标准hello-world项目时,它写下:

The android-platform of project "E:projectscocos_projectstestproj.android" s
hould be equal/larger than 22, but 16 is specified.

在AndroidManifest.xml中,我有:<uses-sdk android:minSdkVersion="9"/>

在SDK manager中,我安装了所有平台,在...sdkplatforms中,我有8、10、15-22和MNC文件夹。

@Andrey的回答基本上是正确的,但为了其他寻找如何解决这个问题的cocos2d-x开发人员,我将用一些缺失的信息来完成它。

此错误:

项目的android平台"E:\projects\cocos_projects\test\proj.android"应等于/大于大于22,但指定了16。

当您告诉cocos命令使用与project properties配置冲突的Android API版本(--ap android-XX)时显示。

假设你的proj.android/project.properties是这样的:

target=android-22
android.library.reference.1=../cocos2d/cocos/platform/android/java

因此,在启动请求使用不同Android API版本(例如cocos compile -p android --ap android-16)的命令之前,您应该手动编辑project.properties并将target密钥更改为与您要使用的新Android API版本相匹配的值。

当我修改...proj.androidproject.properties时,它工作于