Problem with Android Studio Setup guide

Hello,

I’m new with cocos2dx and I try to install the Android studio setup following the doc. First, like the doc said, i try to complete the Android Command-Line Instructions. Everything goes well until this point :

python2.7 android-build.py -p “android-26” cpp-tests
Building mode: debug
Using Eclipse project : /home/pierre/cocos2d-x-3.15.1/tests/cpp-tests/proj.android
Ant (Eclipse project) is not supported from Android SDK Tools 25.3.0.
Build dynamic library for project [ /home/pierre/cocos2d-x-3.15.1/build/…/tests/cpp-tests ] failed!

I dont know how to fix this because it seems like an incompatibility between SDK tools version and Ant.
So I ignore this and I back to the android studio setup insctruction. I launch Android studio, import the cpp test project and I get this error :
Gradle sync failed: A problem occurred configuring project ‘:CppTests’

Now I totaly stuck here.
I’m under Linux (manjaro, archlinux based) and all the prerequisites are installed and works well.
In Android Studio I have Android 8.0 and 7.1.1, SDK Build-Tools Tools PLatform-Tools 26.

Can you help me ?

Check under your “Gradle Scripts”, there is a way to specify the version to use for build tools and sdk.

Copy and paste the gradle console output. I ran into the same issue and I was able to fix it I just cant remember everything I did :frowning:

What do you mean about “Your Gradle Scripts” and “version” of what ?

I pasted already all the outputs I have in the main post.

You talk about this idea log ?

Under Android Studio there is a section with all your “build.gradle” files.

Gradle sync failed: A problem occurred configuring project ‘:CppTests’ cannot possibly all you get. In your Gradle console or “Messages” there should be more details about why “A problem occurred configuring project”

I’m going from the top of my head here as I did not take notes on everything I did to fix the same issue you are facing.

Keep in mind that in my case I did not import cpp-test project. I just opened the android studio project under MyGame/proj.android-studio.

Ok I check in Gradle Console, but the console is clear.

I just noticed this in the log file.

NDK support for project ‘proj.android-studio’ is disabled because the project doesn’t contain any valid native configurations.

Check your NDK settings…I’m going to see what I have for that.

Under “Gradle Scripts” inside “local.properties” file I have:

sdk.dir=C:\\Users\\SuperSecretUser\\AppData\\Local\\Android\\sdk
ndk.dir=C:\\Users\\SuperSecretUser\\AppData\\Local\\Android\\sdk\\ndk-bundle

I do remember updating that file at some point.

Ok, when I try to install NDK from Android studio SDK manager I get this error :
To install:

  • NDK (ndk-bundle)
    Preparing “Install NDK (revision: 15.1.4119039)”.
    Downloading https://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip
    An error occurred while preparing SDK package NDK: Aucun espace disponible sur le périphérique. (= No space available on the device.)
    “Install NDK (revision: 15.1.4119039)” failed.
    Failed packages:
  • NDK (ndk-bundle)

But when I check my disk I have a lot of free space. I understand nothing…

Is the file being downloaded to the /tmp directory maybe?

While I’m familiar with Linux I got my env setup under Windows.

Yep, when the NDK is dowloading, then unzipping, my /tmp becomes full and break the process. :joy: I have never seen that before. You have an idea about this problem ?

edit: To do this, I have increased my /tmp size with size=8G (this process take 4Go) manually, editing my /etc/fstab and the NBK install worked well. So I removed the line ndk.dir I added before in local.properties.
Thanks for help @rnodal_cocos rnodal_cocos

No problem, I wish I could have helped more.