How to integrate Android aar library - cocos2dx C++?

Hi,

How to integrate Android aar to cocos2dx C++ and cocos console?

Most of Android sdk are available in aar format http://tools.android.com/tech-docs/new-build-system/aar-format
i.e.
facebook-android-sdk-4.13.2.aar
extras\android\m2repository\com\android\support\support-v4\24.0.0\support-v4-24.0.0.aar

Regards,
CHP

Use android-studio:) add it as module just google how it works: keywords aar import android studio

Does android-studio and gradle is supported fully by cocos2dx - “cocos console”/NDK/sdkbox etc?

What is your knowledge about cocos2d-x? Are you just starting or already have expierence with it?

Have you checked folder structure inside created project for Android-studio?

Give some more details about you, so I can point to right way:) based on your skills.

Started 1,5 year ago - cocos2dx-3.6
Android/Java/gradle knowledge - almost zero - using only cocos command line “cocos deploy …”

Released apps:
Google Store: 8 apps
https://play.google.com/store/search?q=crazyhappygame

Windows store: 2 apps


Regards,
CHP

Ok, so starting from 3.7 version there is Android-studio with gradle support.

Use proj.android-studio folder for that, open it with android studio itself and then try to use instruction from google how to add aar files to it.

to compile android studio project add in compile comand “–android-studio” flag

Have a try.

OK. So it means that gradle is fully supported in cocos2dx. Thank you. I will try.

Last two question:

  1. Can I use old Android libraries (and aar) in Android-studio project?
  2. Does “cocos gen-libs -p android” for Android-studio. Is there any tutorial how to setup usage of precompiled libraries in Android-studio project?
  1. Yes you can use jar files
    I usually adding them in following way, heyzap subfolder with jar’s in android studio project:
    dependencies {
    compile fileTree(dir: ‘heyzap’, include: [’*.jar’])
    }

  2. Not sure about precompiled libs as wasn’t working with them - should be possible somehow.