Android 目标平台版本应该大于或等于 10(The android-platform should be equal/large than 10)
来源:互联网 发布:新韩顺平php全套视频 编辑:程序博客网 时间:2024/05/22 00:21
cocos compile -p android –-ap 20
注意:如果Android\sdk\platforms目录下没有android-20,需要一个空的。
//D:\cocosDevelop\android-ndk-r10\platforms\android-20
D:\liebao_down\adt-bundle-windows-x86_64-20130917\adt-bundle-windows-x86_64-20130917\sdk\platforms\android-18 (我的是18)
同时要查看命令是否是 –ap 20(双-)。同时检查\proj.android目录下的project.properties是否是android-20
I am able to solve similar issue just as this one. I am running Cocos2d-x v3.6 and able to have this error on both r9d and r10e NDKs. Whenever I ran the android-build.py from the cpp-tests folder I always got this error:
cocos compile -p android -s C:\Cocos2d-x\cocos2d-x-3.6\build..\tests/cpp-tests –ndk-mode debug Running command: compile Building mode: debug Android platform not specified, searching a default one… Can’t find right android-platform for project : “C:\Cocos2d-x\cocos2d-x-3.6\tests\cpp-tests\proj.android”. The android-platform should be equal/larger than 10 Build dynamic library for project [ C:\Cocos2d-x\cocos2d-x-3.6\build..\tests/cpp-tests ] fails!
Also this error appear as well when I tried to create a project and running build_native.py from the project itself.
I am able to figure out maybe because the ANT_ROOT, NDK_BUILD and ANDROID_SDK_ROOT are not being registered into the cocos command properly.
Here what I did:
I deleted all environment variables related to Cocos2d-x (ANT_ROOT, NDK_BUILD and ANDROID_SDK_ROOT).
I went into the Cocos2d-x root folder and ran setup.py again
This time Cocos2d-x asks for the new paths (since we deleted them)
I added the path manually from there then I restarted the console.
I went ahead and tried this tutorial.
I got a slightly different output message than that of the screenshot. I got mine failed but at least, I no longer have the error that says Android platform not specified.
UPDATE: It seems the error is being caused by ANT_ROOT. There is tricky part here. You specify the ANT_ROOT without ; or \ at the end of the path when you insert the path by My Computer > Right Click > Properties > Advance System Settings > Environment Variables (Assuming you are using windows). The cocos build appends an additional directory off from ant and in effect it destroys the actual path during build. Replacing it manually and then restarting console returns back where I was before. I simply did what I have done awhile back (Deleting all environment variable related to Cocos2d-x, this time including ANT_ROOT) and it works! I am able to build the apk and run it on my phone!
Hope this helps someone in the future.
This issue will occur when your environment variable not set properly, I suggest you to set your environment variables properly and then restart command prompt or terminal then execute cocos compile -s projectname -p android if your project compile successfully then you can run this project. hope this helps
- java -version
- python –version
- ant //Buildfile:build.xml does not exist!Build failded
Run setup.py to configure your Android development environment. This will set the necessary environment variables needed. If you haven’t configured this environment before, you will be prompted to enter paths for variables that are not found.
须把你的sdk的tool的文件夹的路径放到path里面,不然就要cd到那儿在android命令。
现在cmd中输入android -h 虽然提示android不是内部或外部指令 说明还没有在path改好。
android list targets
These tutorials cover all steps:
http://www.cocos2d-x.org/wiki/How_to_run_cpp-tests_on_Android
and
http://www.cocos2d-x.org/wiki/How_to_Build_an_Android_Project_with_Eclipse
- Android 目标平台版本应该大于或等于 10(The android-platform should be equal/large than 10)
- 网狐荣耀版android编译时出现“未找到工程,Android 目标平台版本应该大于或等于 21”
- build_native.py 未找到工程 xxx\proj.android' 可用的 Android 目标平台。 Android 目标平台版本应该大于或等于 20
- build_native.py 未找到工程 xxx\proj.android' 可用的 Android 目标平台。 Android 目标平台版本应该大于或等于 20
- eq(equal)等于,ne neq(not equal)不等于,gt(greater than)大于 (smarty)
- android和js调用(大于等于4.2版本的,注意冲突)
- when not using the appcompat library, you should be using the android:showAsAction attribute.
- Android 工具类(将 dp 转成 px 获取屏幕的高度/宽度 判断android SDK 版本是否大于等于5.0)
- jgoodies FormLayout 布局错误The row index 12 must be less than or equal to 10.
- Row index must be greater than or equal to zero and less than the number of rows.
- Android Studio 使用教程(十五)之 This support library should not use a different version(x)than the compileS
- Android添加依赖出现This support library should not use a different version (26) than the compile(25).
- android目标sdk版本
- Job found still running after platform shutdown. Jobs should be canceled by the plugin that sched
- !MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin tha
- Ogre出现”…The minimum corner of the box must be less than or equal to maximum corner”错误
- which Toolkits should i used for Cross-Platform Android Development
- Introducing the Android Computing Platform
- Deep Learning
- 处理百万级以上的数据提高查询速度的方法
- POJ 2996-Help Me with the Game(模拟)
- android Looper Handler机制
- DB2 ODBC简介
- Android 目标平台版本应该大于或等于 10(The android-platform should be equal/large than 10)
- git Bash 安装&配置与基本操作
- 关于IN UPDATE TASK
- Contact Manager Web API - Web API Routing
- flex4 Error #2044: 未处理的 IOErrorEvent:。 text=Error #2032: 流错误
- 实施,运维,开发驻场时与客户沟通需求的案例与技巧
- Bootstrap的js插件之滚动监听(scrollspy)
- Android Material Design之在RecyclerView中嵌套CardView实现
- Caffe 深度学习框架上手教程