Android Studio : Gradle Sync External Native Build Issue

Android Studio : Gradle Sync External Native Build Issue
0

Hi Everybody! I’m new in Cocos and Android App Development in general. I’m trying to understand what I need to build a cocos project for android, and why Android Studio log the next build problem:

I created a new cocos project with : “cocos new TestGame -p org.MettaGame.testGame -l cpp”

It generates the next project:
image

I read something about “build_native.py”… it seems to be deprecated in this version. Now Gradle build the project with CMake, i think… but when I tried to build it with Android Studio, it logged “Build” nad “Sync” problems. I read a little of what is CMakeList.txt and how CMake works, and Gradle too, but… I don’t know what is going on.

I understand your frustrations with gradle, and the lack of any detailed error reporting by default. See if the information in this StackOverflow post helps at all:

how to debug Gradle sync failed

1 Like

It seems you only need to set the NDK path for the project, you can find it in project settings or download with SDK manager

Hello there, finally I found the problems…

– Gradle Sync Problem —:

It seems that CMake needs “Ninja” to works properly, so you need to install it. You can use Chocolatey to install Ninja: https://chocolatey.org/packages/ninja (easy way). After the installation, Gradle can syncronize without errors.

– Build Issue –

The root of my project had blank spaces (noob…). Check your root… my “username” had blank spaces and that caused the problem.

We have added a FAQ about this…not deployed yet, but here is the PR: https://github.com/cocos2d/cocos2d-x-docs/pull/198

1 Like

Ninja can also be downloaded directly from here: https://github.com/ninja-build/ninja/releases

1 Like