Some problems with android studio

Some problems with android studio
0.0 0

#1

When i open cpp-test with android studio i get this error:

Build command failed.

Error while executing process C:\Users\Kevin\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Kevin\Desktop\cocos2d-x-3.16\tests\cpp-tests\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Kevin\Desktop\cocos2d-x-3.16\tests\cpp-tests\proj.android-studio\app\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=0 APP_PLATFORM=android-14 NDK_OUT=C:/Users/Kevin/Desktop/cocos2d-x-3.16/tests/cpp-tests/proj.android-studio/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\Users\Kevin\Desktop\cocos2d-x-3.16\tests\cpp-tests\proj.android-studio\app\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-10 NDK_MODULE_PATH=C:/Users/Kevin/Desktop/cocos2d-x-3.16;C:/Users/Kevin/Desktop/cocos2d-x-3.16/cocos;C:/Users/Kevin/Desktop/cocos2d-x-3.16/external -j4 NDK_DEBUG=0 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}

Android NDK: INTERNAL ERROR: The armeabi ABI should have exactly one architecture definitions. Found: ‘’

process_begin: CreateProcess(NULL, “”, …) failed.

*** Android NDK: Aborting… . Stop.
Open File

Build command failed.

Error while executing process C:\Users\Kevin\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Kevin\Desktop\cocos2d-x-3.16\tests\cpp-tests\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Kevin\Desktop\cocos2d-x-3.16\tests\cpp-tests\proj.android-studio\app\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=1 APP_PLATFORM=android-14 NDK_OUT=C:/Users/Kevin/Desktop/cocos2d-x-3.16/tests/cpp-tests/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\Users\Kevin\Desktop\cocos2d-x-3.16\tests\cpp-tests\proj.android-studio\app\build\intermediates\ndkBuild\debug\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-10 NDK_MODULE_PATH=C:/Users/Kevin/Desktop/cocos2d-x-3.16;C:/Users/Kevin/Desktop/cocos2d-x-3.16/cocos;C:/Users/Kevin/Desktop/cocos2d-x-3.16/external -j4 NDK_DEBUG=1 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}

Android NDK: INTERNAL ERROR: The armeabi ABI should have exactly one architecture definitions. Found: ‘’

process_begin: CreateProcess(NULL, “”, …) failed.

*** Android NDK: Aborting… . Stop.
Open File

if can be helpfull i leave here a screenshot of my Android studio…


#2

What version of Studio? What version of gradle? How did you make this project?


#3

Android studio 3.1.2 is the version.
I didn’t make this project i’ve just opened this project, already created, in the cocos folder
C:\Users\Kevin\Desktop\Android\cocos2d-x-3.16\tests\cpp-tests\proj.android-studio.
I’m sorry i’m newbie in this world and i don’t know what is a “gradle” could you explain me how can i see the version of this?


#4

Actually this is helpful.

Why don’t you snag the latest from GitHub, I think this should solve your issues. We have made a lot of Android Studio changes in this version.


#5

Could you give me a link or something please?
By the way my Gradle version is 3.3


#6

A link to what? Our GitHub repo? https://github.com/cocos2d/cocos2d-x/


#7

A link where i can snag the latest from github


#8

This https://github.com/cocos2d/cocos2d-x/archive/v3.zip ?


#9

ok i did the download of cocos from github but now the command for create a new project:
cocos.py(or cocos) new Game -p … -l cpp -d …
doesn’t work anymore…

‘cocos’ is not recognized as an internal or external command, operable program or batch file
is the error :\


#10

Is cocos in your path? What happens if you run cocos -v?

Did you run:

git clone ...
cd cocos2d-x
git submodule update --init
git submodule update
./download-deps

#11

I found out that the problem of the command error was that, when i did the download from github
the “\cocos2d-x-3\tools\cocos2d-console” was empty so i downloaded it separately and drop the files in cocos2d-console and the command started to work again.
By the way those command lines:

Blockquote
git clone …
cd cocos2d-x
git submodule update --init
git submodule update
./download-deps

doesn’t work the error is the same: ‘git’ is not recognized as an internal or external command, operable program or batch file

i tryed also this version with ‘$’ from github:


#12

Then git is not installed on your system


#13

ok i finally solved the problem thanks to the versione of github.
I’m really grateful to you and for your help.
By the way this command:

git submodule update --init

give me this error:

fatal: not a git repository (or any of the parent directories): .git

i don’t know if this is important or not but finally android studio compile and run my project correctely.
thank you.


#14

You need to Cd into the directory you cloned your repo to. Then execute.


#15

I had the same issue: Trying to do ‘cocos compile -p android --android-studio’ would fail when it would look for the names of the ABIs and finding empty strings -> ‘’

THE SOLUTION WAS TO DOWNLOAD AN OLDER VERSION OF THE NDK!!!

Go and download NDK 14 from the Android developer’s site. I replaced NDK 17 with NDK 14 by putting it in

C:\Users\YourNameHere\AppData\Local\sdk\

The one that I had (NDK 17) was a folder inside …\Android\sdk named ‘ndk-bundle’ so I just unzipped the NDK 14 and renamed it to ‘ndk-bundle’ and threw it in the SDK folder. Since my path variables were already set up, I didn’t have to change them. Then run the cocos compile script from that directory in the cmd window.


#16

ok seems it’s all resolved thanks slackmoehrle.
Megapwnd thanks for the answer but i’ve already resolved