convert cocos2dx ios game into android

  • amisha
    Likes 0

    Problem Description

    I develope the game in cocos2dx 3.7.1 now i want to convert it into the android.Then what is the process to do for convert into android.

  • Sonar Systems admin
    Likes 0

    You should be able to run it in Eclipse/Android Studio and run it

     

    Check this out https://www.youtube.com/watch?v=gdOkbXYsf04

  • amisha
    Likes 0

    Can't find right Android-platform for project : '/Users/apple/Desktop/project 3.7/DressMeUp/proj.android-studio/app'. The Android-platform should be equal/larger than 10.

    Above error coming when i compile project in terminal

    how can i solve


  • amisha
    Likes 0

    now this error come

    Error running command, return code: 1.

     

  • Sonar Systems admin
    Likes 0

    What version of everything are you using?

  • amisha
    Likes 0

    android-ndk-r10e-darwin-x86_64.bin

    apache-ant-1.9.6

    jdk 8

     

    now above error solve but

    Error running command, return code: 2. shown.


  • Sonar Systems admin
    Likes 0

    Try JDK 7

  • amisha
    Likes 0

    i try jdk 7 then also

    make: *** No rule to make target `/Users/apple/Desktop/project3.7/DressMeUp/proj.android-studio/../cocos2d/cocos/ui/hellocpp/main.cpp', needed by `obj/local/armeabi/objs-debug/cocos2dcpp_shared/hellocpp/main.o'.  Stop.
    make: *** Waiting for unfinished jobs....
    make: Leaving directory `/Users/apple/Desktop/project3.7/DressMeUp/proj.android-studio/app'
    Error running command, return code: 2.

     

     

     

     

  • Sonar Systems admin
    Likes 0

    Try a fresh project on android see if that works.

  • amisha
    Likes 0

    ya its work

    but i have one another problem

    undefined reference to 'cocos2d::ccArraySwapObjectsAtIndexes(cocos2d::_ccArray*, int, int)'
    collect2: error: ld returned 1 exit status
    make: *** [obj/local/armeabi/libcocos2dcpp.so] Error 1
    make: Leaving directory `/Users/apple/Desktop/MYBACKUP/DressMeUp/proj.android'
    Error running command, return code: 2.

    is here the problem in ccarray.cpp  or any other issue..

     


  • Sonar Systems admin
    Likes 0

    What code in your project is this occuring with?

  • amisha
    Likes 0

    when i transfer the new scene on next button tap.I write this code for transfer the new scene

     Scene *scene =Level_Screen::scene();
        Director::getInstance( )->replaceScene(TransitionShrinkGrow::create(0.5,scene));

    At this line erroe occure :

     

    jni/../../Classes/HelloWorldScene.cpp:1134: error: undefined reference to 'Level_Screen::scene();

    collect2: error: ld returned 1 exit status
    make: *** [obj/local/armeabi/libcocos2dcpp.so] Error 1

    Error running command, return code: 2.

    I use android-studio for compile

     

     


    This reply has been verified.
  • Sonar Systems admin
    Likes 0

    Could you show use the .h and .cpp files for Level_Screen class


    This reply has been verified.
  • amisha
    Likes 0

    yes its include

    in ios ,it is run smoothely but during the android compilation ,this error occur


  • Sonar Systems admin
    Likes 0

    Have you built it for Android?

  • amisha
    Likes 0

    i just compile the ios project into terminal for running project in android studio. Now project compile succesfully but when i run the apk then it crash  and “ Unfortunty  libcocs2dx not found.” message show.

    What is the problem and how can i solve this


  • Sonar Systems admin
    Likes 0

    Have you comiled it using the cocos compile -p android --android-studio command first?

  • amisha
    Likes 0

    yes first compile and then build succesfully message get .

    Then project import into android studio and run.

    But pop-up generate  with  libcocos2dx file not found  during the  run in  simulator.


  • Sonar Systems admin
    Likes 0

    Try it in Eclipse and let us know how it goes.

  • amisha
    Likes 0

    when I take 4 to 5 sprite  in init() then its run but during multipal   sprite run then its crash .What is the problem behind this??

  • Sonar Systems admin
    Likes 0

    What do you mean by multiple sprites?

  • amisha
    Likes 0

    now its solve ..there was memory problem

    thanks a lot

  • Sonar Systems admin
    Likes 0

    COOL, great to hear, happy developing :D

Login to reply