cant build for android


Active member
Jul 13, 2017
just updated to api 29 and 30, installed cmake, ndk and a bunch of other things and build fails

release keeps saying waiting for device

and this on debug
TRANS cerberus compiler V2021-03-21
:app:preBuild UP-TO-DATE
:app:compileDebugAidl NO-SOURCE
:app:prepareLintJar UP-TO-DATE
Note: C:\Users\eric_\Desktop\adventures of AZ styles\azstyles.buildv2021-05-16\android\app\src\main\java\com\cerberus\cerberusgame\ uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:app:compileDebugNdk NO-SOURCE
:app:processDebugJavaRes NO-SOURCE
09:33:14 V/ddms: execute: running am get-config
09:33:14 V/ddms: Got reply 'FAIL', diag='closed'

09:33:14 E/ddms: ADB rejected shell command (am get-config): closed
09:33:14 V/ddms: execute: returning
:app:installDebug FAILED
29 actionable tasks: 28 executed, 1 up-to-date
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> closed

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at

TRANS FAILED: Android build failed.
Make sure that the developer mode is enabled on the Android device. Install any USB drivers if required on the host system. Keep an eye on the android device as sometimes you can miss the except dialog for the connection to allow the PC to upload the apk etc to the device.
No device plugged in at all, just want to build an APK and install Manually

Do I need a device plugged in?
Built an APK before no problems figured some things needed updating
Last edited:
Well, judging from the messages, the build process should be fine. It is just the automatic installation that is failing. But I will try myself.
But I will try myself.
Just tried. When I build without a device connected, I get the same message like you.
But the apk is created:
Ok thanks Mike I will check when I get home
Can you explain or point me to some info on the device part of this. Is it phone and what happens exactly?
At this point CX gives the ADB tool of Android Studio the command to install it onto a connected device like a phone or a simulator that is already active.
And that part can't be done.
cool seems i just forgot where to find it! But when i build a release ver. it says waiting for device forever, did i possibly install something i shouldnt have or is there a way to bypass that thanks
Hi, I haven't compiled anything for Android in a while and tried again today with the latest CX github version + Android Studio 4.2 + lastest SDK Build Tools+API 28, 29, 30 installed + licenses copied to my C:\Android\Android Studio directory

When I try to compile, here is what i get :
Warning: Dependant package with key emulator not found!

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Failed to install the following SDK components: build-tools;30.0.3 Android SDK Build-Tools 30.0.3 Install the missing components using the SDK manager in Android Studio.
Any idea why? Thanks!
@MikeHart and me did some testing on this and came up with the following:
Change the java path to yourAndroidStudioFolder\jre to use the inbuilt java sdk of Android Studio
Change the following config values in targets/android/template/config.cxs
Delete your build folder to get a fresh build.

BTW These changes are already in the develop branch on GitHub

Edit: I should have read more properly ... you are using the develop version!?
Did you try opening Android Studio with your project? Sometimes it gives you some more hints or solves the problem with the sdk for you.
Last edited:
Thanks a lot Phil (and the team)! I do use the develop version. Well I deleted the build folder, tried to build again using CX which lead to the same messages than before, than I imported the Android build directory into Android Studio.

I got that message from Android Studio when importing :

The project and Android Studio point to different Android SDKs.

Android Studio's default SDK is in:

The project's SDK (specified in is in:
C:\Android\Android Studio

To keep results consistent between IDE and command line builds, only one path can be used. Do you want to:

[1] Use Android Studio's default SDK (modifies the project's file.)

[2] Use the project's SDK (modifies Android Studio's default.)

Note that switching SDKs could cause compile errors if the selected SDK doesn't have the necessary Android platforms or build tools.
and then chose Android Studio's SDK, then I built the project inside Android Studio, it all went fine, Android Studio advised me to update Android Gradle Plugin, which I didn't. Then after closing the app I was able to compile it again inside CerberusX.
I don't have a clue what happened , maybe you do, anyway it's working again thanks to you!
I have rebuild the gradle wrapper jar file and uploaded the new version to the repository. It build before that on my system too, but who knows :)

I have tested it with the latest Android version, but without any admob or iap stuff.
Also I am linking to the JRE now instead of a separate JAVA installation.

My config file entries look like this:

'Java dev kit path
'Must be set to a valid dir for ANDROID and FLASH target support
'The Java JDK is currently available here:
JDK_PATH="D:\Program Files\Android\Android Studio\jre"

'Android SDK and tool paths.
'Must be set to a valid dir for ANDROID target support

Linking to the SDK path inside your local appdata directory avoids the copying of the licenses folder.

So basically I just installed the latest Android Studio. Then started it. It asked for the SDK directory but I had deleted that before. So I canceled that dialog when it wanted to recreate it and download SDK 30. I let it do that. After it was finished, CX build out of the box with the paths set in its config file in the bin directory.

EDIT: Make sure a licenses folder exists. I just did the procedure again and I needed to install an SDK from within studio to create the licenses folder in C:\Users\mike\AppData\Local\Android\Sdk. Have to see if I can automate this further.
Last edited:
Thanks Phil7 and Mike! Incredible how every problem we occasionnaly stumble upon gets a quick and simple solution here thanks to one of you. We will never be able to thank you enough for your dedication!
Thank you for these kind words. This community and its atmosphere is really something special. Most of the things I do here just don't feel like work. It's what I do when I don't have any energy left for the tedious stuff I have to do otherwise.
Last edited:
Top Bottom