Error while compiling cocos project in android device

  • freela
    Likes 0

    Problem Description

    I have an cocos project in cocos2dx 3.13.1. After making some changes in the project, i compiled it for ios devices and it works well, but while compiling in android using cocos compile -p android --android-studio command in terminal, I have used Android SDK Tools Version 26.0.2, android-ndk-r14b and apache-ant-1.10.1. I faced following error while compiling.

    Android NDK: WARNING: Unsupported source file extensions in jni/Android.mk for module cocos2dcpp_shared    
    Android NDK:   ../../../Classes/NewsLayer    
    Android NDK: ERROR:/Users/freela/Desktop/Testing/cocos2d/external/freetype2/prebuilt/android/Android.mk:cocos_freetype2_static: LOCAL_SRC_FILES points to a missing file    
    Android NDK: Check that /Users/freela/Desktop/Testing/cocos2d/external/freetype2/prebuilt/android/x86_64/libfreetype.a exists  or that its path is correct   
    make: Entering directory `/Users/freela/Desktop/Testing/proj.android-studio/app'
    /Users/freela/development/java/android-ndk-r14b/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.
    make: Leaving directory `/Users/freela/Desktop/Testing/proj.android-studio/app'
    Error running command, return code: 2.

     

  • Sonar Systems admin
    Likes 0

    Is this a fresh project?

  • freela
    Likes 0

    This project was an existing project. i have made some modifications to the project some days ago.

  • Sonar Systems admin
    Likes 0

    Does a fresh project work for you?

  • freela
    Likes 0

    Fresh project also doesnot works for me. i have faced following error while trying to compile using cocos compile -p android --android-studio command

     

    *************************************************************************
    The "android" command is deprecated.
    For manual SDK, AVD, and project management, please use Android Studio.
    For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
    *************************************************************************
    Invalid or unsupported command "update project -t android-13 -p /Users/pradipbhattarai/Desktop/hellocpp/proj.android-studio/app"

    Supported commands are:
    android list target
    android list avd
    android list device
    android create avd
    android move avd
    android delete avd
    android list sdk
    android update sdk
    Error running command, return code: 2.

  • Sonar Systems admin
    Likes 0

    First lets get a fresh project working for you.

     

    Try running it within Eclipse using the regular android commands to see if that works which will help us identify if its an android studio issue or a cocos issue.

  • freela
    Likes 0

    Please help me to find correct versions of Android NDK, Android SDK, Apache ANT for compiling cocos2dx 3.13.? I think compilation faied due to incorrect version of Android NDK, Android SDK, Apache ANT.

  • Sonar Systems admin
    Likes 0

    Which versions did you use?

  • freela
    Likes 0

    have used Android SDK Tools Version 26.0.2, android-ndk-r14b and apache-ant-1.10.1 with cocos2dx 3.13.

  • Sonar Systems admin
    Likes 0

    Try an older Android SDK like 23

Login to reply