简体   繁体   English

为什么编译时无法将android-platform设置为低于22?

[英]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.

相关问题 如何在调试模式下将Qt Creator中的--android-platform更改为不是android-1? - How can I change the --android-platform in Qt Creator to not be android--1 in debug mode? 为什么我不能使用较低的API编译android studio项目? - Why can't I compile an android studio project using lower API? 为什么我不能使用较低的Android版本构建应用程序? - Why I can't build app with for a lower Android version? 为什么我不能在Android平台上显示图像 - Why I can't display the image on Android platform 我无法在 API &lt;=22(使用 Android Studio 和 Unity)的设备中启动手电筒。为什么? - I can't start torch in device with API <=22(Used Android Studio and Unity) .why? 为什么我无法使用其他API编译我的android项目 - Why i can't compile my android project with other APIs Android版平台上的多版应用程序? [Android Build Variant] - Multi Edition of an app on Android-platform? [Android Build Variant] 我可以在android应用程序的主题中设置android:textColor,但不能设置android:text-为什么? - I can set android:textColor in android application's theme, but I can't set android:text - why? 为什么我不能使用Android HTTPURLConnection设置标头? - Why can't I set header with Android HTTPURLConnection? 为什么不能在Android WebView onLayout中设置maxwidth? - Why can't I set maxwidth in Android WebView onLayout?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM