cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.22k stars 7.06k forks source link

New project doesn't run on ios and android #18246

Open jiteshwadia opened 7 years ago

jiteshwadia commented 7 years ago

Hi,

Issue: I created my first project in cocos2d-x and its working only for web, but not for ios and android.

I have setup ANT_PATH path in .bash_profile too.

- cocos2d-x version: 3.15
- Python version: 2.7.10
- Cocos console version: 2.3
- devices test on: iOS simulator
- developing environments
   - Xcode version: 8.3.3

log for ios,

Build succeed.
Deploying mode: debug
Starting application.
Traceback (most recent call last):
  File "/Users/jitesh/Documents/cocos2d-x-3.15/tools/cocos2d-console/bin/cocos.py", line 1027, in <module>
    run_plugin(command, argv, plugins)
  File "/Users/jitesh/Documents/cocos2d-x-3.15/tools/cocos2d-console/bin/cocos.py", line 916, in run_plugin
    plugin.run(argv, dependencies_objects)
  File "/Users/jitesh/Documents/cocos2d-x-3.15/tools/cocos2d-console/plugins/plugin_run/project_run.py", line 344, in run
    self.run_ios_sim(dependencies)
  File "/Users/jitesh/Documents/cocos2d-x-3.15/tools/cocos2d-console/plugins/plugin_run/project_run.py", line 192, in run_ios_sim
    self._run_ios_app(deploy_dep._iosapp_path)
  File "/Users/jitesh/Documents/cocos2d-x-3.15/tools/cocos2d-console/plugins/plugin_run/project_run.py", line 165, in _run_ios_app
    simulator_id = self._get_simulator_id()
  File "/Users/jitesh/Documents/cocos2d-x-3.15/tools/cocos2d-console/plugins/plugin_run/project_run.py", line 124, in _get_simulator_id
    tmpIOSVer = float(match.group(3))

log for android,

cocos compile -p android
Python 2.7.10
Building mode: debug
Using Eclipse project : /Users/jitesh/Documents/Jitesh/MyGame/frameworks/runtime-src/proj.android
The directory 'android-13' can't be found in ANDROID_SDK_ROOT/platforms, please use --ap to set needed API level

Steps to Reproduce:

  1. Create new project using: cocos new MyGame -p com.myprofile.xyz -l js
  2. cd MyGame & than for ios, cocos run -p ios
  3. for android, cocos run -p android

Thanks

wnddpd01 commented 7 years ago

i think you dont have android-13 SDK

set your project min sdk or install sdk