HOW TO: Build Android target

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
I wouldn't worry about it. Mine did the same. But at the end it builds smoothly.
 

Paul Holloway

New member
Joined
Aug 19, 2018
Messages
7
Have just noticed I have two Android Studio installations and suspect this may be the issue - not sure how I managed that but I'll see if resolving this works.
 

Paul Holloway

New member
Joined
Aug 19, 2018
Messages
7
I wouldn't worry about it. Mine did the same. But at the end it builds smoothly.
Thanks Mike, I appreciate your assistance, but it didn't build - no .apk file generated. A simple restart seems to have resolved some of my problems - it installed SDK and tools v27 OK, though I'm still a bit puzzled by this as v28 is specified in config.cxs.

I'm now getting a different error:

FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not resolve com.google.code.gson:gson:2.8.4.
Required by:
project :app > com.google.android.ads.consent:consent-library:1.0.3
> Could not resolve com.google.code.gson:gson:2.8.4.
> Could not get resource 'https://jcenter.bintray.com/com/google/code/gson/gson/2.8.4/gson-2.8.4.pom'.

> Could not GET 'https://jcenter.bintray.com/com/google/code/gson/gson/2.8.4/gson-2.8.4.pom'.

> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target​

I can download gson-2.8.4.pom manually - any idea where I might put it to get this to work?
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
No, no idea. Ca you share a small example project that will show this error so I can try myself?
Which platform are you on?
 

Paul Holloway

New member
Joined
Aug 19, 2018
Messages
7
I'm on Windows 10.

I updated the GSON ( https://github.com/google/gson/releases/tag/gson-parent-2.8.5 ) and I'm now getting a different error:

FAILURE: Build failed with an exception.
28 actionable tasks: 27 executed, 1 up-to-date
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!​

I tried a small project - Cartoon Clouds - from http://monkeygameprogramming.blogspot.com/ (second project down) which builds for HTML5 but Android build fails giving above error as it does for my project, which used to build using Monkey.
 

Paul Holloway

New member
Joined
Aug 19, 2018
Messages
7
Sorry, I was mistaken, it did generate an .apk when building for release, in the project's build \android\app\build\outputs\apk\release folder - is that the usual place? It just fails to build when debugging or when I build and run, presumably because I don't have an Android emulator installed. I took a break from programming due to ill-health for a few years and my memory appears to have a few patchy areas so I may be asking some dumb questions here. Apologies if so.

I do have another small problem - the apk's generates an error 'There is a problem parsing the package' when attempting to install on my Kindle Fire HD, but installs and runs OK on a Lenovo Yogabook, both my project and the cartoon clouds one. I'll have to have a think about that - maybe Android version?.
 

Paul Holloway

New member
Joined
Aug 19, 2018
Messages
7
Thanks again Mike. My old Kindle Fire HD runs a version of Android 4.0.3 that has been fiddled with by Amazon, but it used to run compiled Monkey X projects a couple of years ago. It isn't really important as I have other more modern devices I can use for testing.
 

hsretrogames

New member
Joined
Sep 25, 2018
Messages
25
No matter what I've done, I can't get this build to work! I have followed all the android target instructions thoroughly.

Do I need to run cerberus or android sdk manager as administrator? i recall when using Monkey compiler I had to run sdk manager as adminstrator. (which I think I've all ready tried in this case)
As you can see below, all the licenses are accepted. Also, looking in c:\users\admin\etc... folder the sdks and api files and folders are all there - so as far as I know nothing is missing. but get the write error, like it doesn't have permission to write, or acts like the sdk/api files are missing ...
Please help!

"C:/Cerberus_v2018_08_10/bin/transcc_winnt" -target=Android_Game -config=Debug "C:/Cerberus_v2018_08_10/MyStuff/WoodRoom2/WoodRoom2.monkey"

TRANS cerberus compiler V2018-08-10
Parsing...
Semanting...
Translating...
Building...

Checking the license for package Android SDK Build-Tools 27.0.3 in C:\Program Files\Android\Android Studio\licenses
License for package Android SDK Build-Tools 27.0.3 accepted.
Preparing "Install Android SDK Build-Tools 27.0.3 (revision: 27.0.3)".
Warning: Failed to read or create install properties file.
Checking the license for package Android SDK Platform 28 in C:\Program Files\Android\Android Studio\licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
Warning: Failed to read or create install properties file.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following SDK components:
platforms;android-28 Android SDK Platform 28
build-tools;27.0.3 Android SDK Build-Tools 27.0.3
The SDK directory is not writable (C:\Program Files\Android\Android Studio)

* 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 https://help.gradle.org
BUILD FAILED in 11s
TRANS FAILED: Android build failed.

Done.

Sorry to bother about this, as it seems others had this issue?
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
Sorry to bother about this, as it seems others had this issue?
That looks like you have a problem with Android Studio. Maybe try to reinstall.

Do I need to run cerberus or android sdk manager as administrator?
I always install stuff as an admin. But running, no. I installed 28 and 27 from within Android studio with the tools needed. Then copied
the licenses directory like mentioned in the first post.

Your error I never saw before.

upload_2018-9-28_22-6-21.png


upload_2018-9-28_22-6-43.png
 

hsretrogames

New member
Joined
Sep 25, 2018
Messages
25
Thanks for the reply!
Looking at your sdk manager, looks like I don't have a couple things installed that you do - CMake, LLDB, NDK and Google Play Licensing Library. I don't need the NDK do I? I thought it wasn't necessary with this type of gradle build? Nonetheless, I'll try installing the stuff thats missing and try again - Thanks.

** EDIT **
Ok, I installed the stuff I was missing (Cmake, LLDB and License Lib) based on your screen shot - Build finally works - whew! Thanks for your help and posting that pic!

:app:installDebug
Installing APK 'app-debug.apk' on 'SM-G950U - 8.0.0' for app:debug
Installed on 1 device.
BUILD SUCCESSFUL in 45s
28 actionable tasks: 27 executed, 1 up-to-date
Done.
 
Last edited:

hsretrogames

New member
Joined
Sep 25, 2018
Messages
25
So, I've started the long task of updating all 29 of my apps on Google Play - Everything is building OK but Admob doesn't seem to be working. I haven't noticed any errors, but the interstitial ads aren't showing at all and the banner is a black rectangle. I remember this happening before but have forgotten how to remedy it. Am I forgetting something somewhere?
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
So, I've started the long task of updating all 29 of my apps on Google Play - Everything is building OK but Admob doesn't seem to be working. I haven't noticed any errors, but the interstitial ads aren't showing at all and the banner is a black rectangle. I remember this happening before but have forgotten how to remedy it. Am I forgetting something somewhere?
Ouch. I will have a look.
 

Galaxy613

New member
Joined
Jan 26, 2019
Messages
3
Hey, I finally want to try to deploy on Android again for the first time since Monkey, but this is the console output when I try:

code_language.cerberus:
"D:/Dev/cerberus-v2018-12-30/bin/transcc_winnt" -target=Android_Game -config=Debug "D:/Dev/Pew Pew Laser Beams/Videogame/pew_pew_laser_beams.cxs"
TRANS cerberus compiler V2018-08-10
Parsing...
Semanting...
Translating...
Building...
Starting a Gradle Daemon, 4 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\Dev\Pew Pew Laser Beams\Videogame\pew_pew_laser_beams.buildv2018-12-30\android\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Minimum supported Gradle version is 4.10.1. Current version is 4.4. If using the gradle wrapper, try editing the distributionUrl in D:\Dev\Pew Pew Laser Beams\Videogame\pew_pew_laser_beams.buildv2018-12-30\android\gradle\wrapper\gradle-wrapper.properties to gradle-4.10.1-all.zip

* 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 https://help.gradle.org

BUILD FAILED in 4s
TRANS FAILED: Android build failed.

Any thoughts/what info would help figure this out?
 
Top Bottom