problems to deploy with cerberus x for Android....I use a macmini 2021 M1 Processor

Fasasoftware

New member
Joined
Oct 5, 2020
Messages
15
Hi, i have some problems to deploy with cerberus x for Android....I use a macmini 2021 M1 Processor....very good....
can somebody help me to deploy for android with my new mac???
I have installed:
-Android: 4.1.1 for mac os x
-Java 15.0.1 x64 for mac os x

i have tried without success to modify the config file for mac in cerberus deploy folder...

I thank you so much! best regards, Lestroso...



"/Users/saverio/Desktop/Cerberus/bin/transcc_macos" -target=Android_Game -config=Release -run "/Users/saverio/Desktop/Cerberus/modules/vortex/demos/demo_mars.cxs"

TRANS cerberus compiler V2020-10-11

Parsing...

Semanting...

Translating...

Building...



FAILURE: Build failed with an exception.



* What went wrong:

Could not determine java version from '15.0.1'.



* 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

TRANS FAILED: Android build failed.

Done.
 

Jimmy

New member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
569
Have you installed Apache-ant?

I added only this to my mac settings file, the rest is untouched :
ANT_PATH="${HOME}/apache-ant-1.10.8"
ANT_PATH="${CERBERUSDIR}/apache-ant-1.10.8"

(you just need one but I kept the original one when I changed it)
 
Last edited:

Jimmy

New member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
569
I'm not sure if JAVA JDK version is important but I successfully use this one

java -version

java version "1.8.0_251"

Java(TM) SE Runtime Environment (build 1.8.0_251-b08)

Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
This looks like an issue with gradle. It needs updating to a more recent version.
Had this problem on Linux and I forgot to mention it to @MikeHart.
Plus CR/FL line endings being used on the gradle posix files causing head aches in Linux.

I think 4.10.3 distribution was the one I used, but I will have to double check on it.
@Fasasoftware : If you want to try for yourself. Edit the line shown below in the file targets/android/template/config.cxs
#ANDROID_GRADLE_DISTRIBUTION="gradle-4.6-all.zip"
And change the name of the file in the line above to one of the distributed 'complete' versions from here.

Or change the line found in the same file .buildv2020-xx-xx\android directory.

If you are still having issues, then switch to using an earlier JDK version.

EDIT: The gradle distribution that still works but with a warnings is gradle-4.10.3-all.zip. Any version after that it breaks.
 
Last edited:

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
@dawlane , what do you suggest regarding the file endings issue?
Only thing I can think of would be to add the offending files (and maybe paths) to .gitattributes with eol's set to LF and do a local repository refresh before any new builds. I don't think gradle on windows cares about the line endings, but I would make a full backup of the local repository before making any changes and then check that the android templates still work across all platforms.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
Thanks, I have to read up how to add these files/paths to .gitattributes
 

Fasasoftware

New member
Joined
Oct 5, 2020
Messages
15
Dear friends,
I have tryed this and it worked for half..but i'm going on straight....ok listen....
1)Deleted jdk-15.0.1.jdk on my mac library by myself..
2)Installed the new jre-8u271-macosx-x64.dmg and boom... it works now but not complete...now the cerberus give me another new error....

Also where i put put the keytool license??
Now, in truth i have only installed the android API 30....but Cerberus ask me for Api28...How i can change it???Thanks a lot everybody..Lestroso


Here the new error.:
code_language.cerberus:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     platforms;android-28 Android SDK Platform 28
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: /Users/saverio/Library/Android/sdk

* 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 41s
TRANS FAILED: Android build failed.
Done.
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
Dear friends,
I have tryed this and it worked for half..but i'm going on straight....ok listen....
1)Deleted jdk-15.0.1.jdk on my mac library by myself..
2)Installed the new jre-8u271-macosx-x64.dmg and boom... it works now but not complete...now the cerberus give me another new error....

Also where i put put the keytool license??
Now, in truth i have only installed the android API 30....but Cerberus ask me for Api28...How i can change it???Thanks a lot everybody..Lestroso


Here the new error.:
code_language.cerberus:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     platforms;android-28 Android SDK Platform 28
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: /Users/saverio/Library/Android/sdk

* 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 41s
TRANS FAILED: Android build failed.
Done.
Depends on how you've installed the Android SDK.
If you've installed it via Android studio.
 

Martin

Active member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Joined
Jun 19, 2017
Messages
320
Failed to install the following Android SDK packages as some licences have not been accepted.

That's the root cause, the licenses haven't been accepted. Try this from the command line:

Code:
~/Library/Android/sdk/tools/bin/sdkmanager --licenses
 

Fasasoftware

New member
Joined
Oct 5, 2020
Messages
15
I'm sorry... but i don't know where is the problem....the compiler don't work for android...where i'm wrong???

I include here the errors...i have installed android studio.. from his webpage and installed the jre-8u271-macosx-x64.dmg on my mac..


Here first the config.cxs

code_language.cerberus:
#ADMOB_PUBLISHER_ID="abcdabcdabcdabc"                            'from your admod account
#ADMOB_ANDROID_TEST_DEVICE1="TEST_EMULATOR"
#ADMOB_ANDROID_TEST_DEVICE2="ABCDABCDABCDABCDABCDABCDABCDABCD"    'your device's admob ID for test mode
#ADMOB_ANDROID_TEST_DEVICE3=""
#ADMOB_ANDROID_TEST_DEVICE4=""

#MOJO_HICOLOR_TEXTURES=True
#MOJO_IMAGE_FILTERING_ENABLED=True

#ANDROID_APP_LABEL="Cerberus Game"
#ANDROID_APP_PACKAGE="com.fasasoftware.cerberusgame"
#ANDROID_SCREEN_ORIENTATION="user"                    '"user", "portrait", "landscape"
#ANDROID_GAMEPAD_ENABLED=False
#ANDROID_MIN_SDK_VERSION="16"
#ANDROID_TARGET_SDK_VERSION="30"
#ANDROID_BUILD_TOOLS_VERSION="30.0.0"
#ANDROID_GRADLE_VERSION="3.2.1"
#ANDROID_GRADLE_DISTRIBUTION="gradle-6.7.1-all.zip"
#ANDROID_REPOSITORIES=""
#ANDROID_JAVA_SOURCE_VERSION="VERSION_1.8.0_271-b09"
#ANDROID_JAVA_TARGET_VERSION="VERSION_1.8.0_271-b09"
#ANDROID_APPLICATION_EXTRAS=""

#ANDROID_VERSION_CODE="1"
#ANDROID_VERSION_NAME="1.0"

#ANDROID_KEY_STORE="../release-key.keystore"
#ANDROID_KEY_ALIAS="release-key-alias"
#ANDROID_KEY_STORE_PASSWORD="password"
#ANDROID_KEY_ALIAS_PASSWORD="password"
#ANDROID_SIGN_APP=False

#OPENGL_GLES20_ENABLED=False

#ANDROID_NATIVE_GL_ENABLED=False

#TEXT_FILES+="*.txt|*.xml|*.json"
#IMAGE_FILES+="*.png|*.jpg|*.gif|*.bmp"
#SOUND_FILES+="*.wav|*.ogg|*.mp3|*.m4a"
#MUSIC_FILES+="*.wav|*.ogg|*.mp3|*.m4a"
#BINARY_FILES+="*.bin|*.dat"


And then here the compile errors.:

code_language.cerberus:
"

/Users/saverio/Desktop/Cerberus/bin/transcc_macos" -target=Android_Game -config=Release -run "/Users/saverio/Desktop/Cerberus/examples/mojo/beaker/angelfont_example/angelfont_example.cxs"
TRANS cerberus compiler V2020-10-11
Parsing...
Semanting...
Translating...
Building...

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/saverio/Desktop/Cerberus/examples/mojo/beaker/angelfont_example/angelfont_example.buildv2020-12-05/android/app/build.gradle' line: 8

* What went wrong:
Could not compile build file '/Users/saverio/Desktop/Cerberus/examples/mojo/beaker/angelfont_example/angelfont_example.buildv2020-12-05/android/app/build.gradle'.
> startup failed:
  build file '/Users/saverio/Desktop/Cerberus/examples/mojo/beaker/angelfont_example/angelfont_example.buildv2020-12-05/android/app/build.gradle': 8: unexpected token: 8.0_271 @ line 8, column 51.
     ibility JavaVersion.VERSION_1.8.0_271-b0
                                   ^
 
  1 error


* 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 1s
TRANS FAILED: Android build failed.
Done.
Thanks a lot for your help...Lestroso
 

Martin

Active member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Joined
Jun 19, 2017
Messages
320
The error above means that it simply don't understand your version "VERSION_1.8.0_271-b09" and neither do I (actually that should just be "VERSION_1_8")

What happens if you remove those lines? Edit: With "removing" I mean if you have them in your own project. Don't remove the original ones in the config.cxs of course. If you have changed it there, reset it to the original ones.

Code:
#ANDROID_BUILD_TOOLS_VERSION="30.0.0"
#ANDROID_GRADLE_VERSION="3.2.1"
#ANDROID_GRADLE_DISTRIBUTION="gradle-6.7.1-all.zip"
#ANDROID_REPOSITORIES=""
#ANDROID_JAVA_SOURCE_VERSION="VERSION_1.8.0_271-b09"
#ANDROID_JAVA_TARGET_VERSION="VERSION_1.8.0_271-b09"
#ANDROID_APPLICATION_EXTRAS=""

The standard should work actually.

Try to use target SDK 29 instead of 30, as I had some issues with the latest one:
Code:
#ANDROID_TARGET_SDK_VERSION="29"
 
Last edited:

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
The current gradle template breaks with any version above 4.10.3
#ANDROID_GRADLE_DISTRIBUTION="gradle-6.7.1-all.zip"
Should be:
#ANDROID_GRADLE_DISTRIBUTION="gradle-4.10.3-all.zip"

Make sure you are using a Java Development Kit (JDK) and not a Java Runtime Environment (JRE).
Make sure that the JDK_PATH in config.macos.txt points to the root directory of the JDK.

Remove old cached gradle files. You will find these in a hidden .gradle directory within the /Users/saverio. Just delete it.
You will need to be familiar with the command line to remove them. Or know how to get Finder to show all files.
 

Fasasoftware

New member
Joined
Oct 5, 2020
Messages
15
I'M sorry again.... i have made a lot of experiment without or half success...

i have tryed to install a fresh copy of cerberus....but if i leave it on application folder...the app start and don't work...Seem a problem of permission on my mac or in all mac... cerberus sa that cannot create a folder to deploy the app....is it right?? or i'm the alone that don't work so?...
Then i have putted on my desktop the cerberus folder...and boom it works all deploy but not the android for other problems...
here below the code it give to me cerberus....Can some body help me again please???Lestroso


compiler tell this:

/Users/saverio/Desktop/Cerberus/bin/transcc_macos" -target=Android_Game -config=Debug "/Users/saverio/Desktop/Cerberus/examples/mojo/devolonter/matchup/matchup.cxs"
TRANS cerberus compiler V2020-10-11
Parsing...
Semanting...
Translating...
Building...
Downloading https://services.gradle.org/distributions/gradle-4.6-all.zip

etcetera.....

Download https://dl.google.com/dl/android/ma...pt2/3.2.1-4818971/aapt2-3.2.1-4818971-osx.jar
:app:createDebugCompatibleScreenManifests
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug
:app:processDebugResources
:app:generateDebugSources
:app:javaPreCompileDebug
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
16 actionable tasks: 15 executed, 1 up-to-date
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.

* 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 1m 26s
TRANS FAILED: Android build failed.
Done.
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.
You have something wrong with your JDK installation or you do not have a JDK installed.
To check that it is installed correctly, open the command terminal Applications/Utilities/Terminal
And type:
javac --version

You should see something like this if it is installed correctly.
javac 15.0.1

If you don't see anything like above, or the version prints javac 1.6 or something similar, then download:
Download the Oracle 15 JDK installer for OSX.

Do a google search for issues related to the installation of any JDK as each version of Mac OSX and Java changes the locations of where it will be installed.
You have not updated the line #ANDROID_GRADLE_DISTRIBUTION="gradle-4.6-all.zip" to #ANDROID_GRADLE_DISTRIBUTION="gradle-4.10.3-all.zip" in Cerberus/targets/android/templates/config.cxs

You will end up back where you started from.
 

Martin

Active member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Joined
Jun 19, 2017
Messages
320
Hmm ya sorry, I might have added some confusion here. I think you already were on the right track. The build process just stumbled over that weird version number. Let's go step by step through this, @dawline is correct. Do you have the right JDK installed? I still used 1.8.0 but 15 should work too?
 

Fasasoftware

New member
Joined
Oct 5, 2020
Messages
15
it'a a tunnel without the finish........
well , i have followed the steps of dawlane...but without success here the screenshot and this is ok... i have modify the gradle information like this...


code_language.cerberus:
#ADMOB_PUBLISHER_ID="abcdabcdabcdabc"                            'from your admod account
#ADMOB_ANDROID_TEST_DEVICE1="TEST_EMULATOR"
#ADMOB_ANDROID_TEST_DEVICE2="ABCDABCDABCDABCDABCDABCDABCDABCD"    'your device's admob ID for test mode
#ADMOB_ANDROID_TEST_DEVICE3=""
#ADMOB_ANDROID_TEST_DEVICE4=""

#MOJO_HICOLOR_TEXTURES=True
#MOJO_IMAGE_FILTERING_ENABLED=True

#ANDROID_APP_LABEL="Cerberus Game"
#ANDROID_APP_PACKAGE="com.cerberus.cerberusgame"
#ANDROID_SCREEN_ORIENTATION="user"                    '"user", "portrait", "landscape"
#ANDROID_GAMEPAD_ENABLED=False
#ANDROID_MIN_SDK_VERSION="16"
#ANDROID_TARGET_SDK_VERSION="28"
#ANDROID_BUILD_TOOLS_VERSION="28.0.3"
#ANDROID_GRADLE_VERSION="4.10.3"
#ANDROID_GRADLE_DISTRIBUTION="gradle-4.10.3-all.zip"
#ANDROID_REPOSITORIES=""
#ANDROID_JAVA_SOURCE_VERSION="VERSION_15"
#ANDROID_JAVA_TARGET_VERSION="VERSION_15"
#ANDROID_APPLICATION_EXTRAS=""

#ANDROID_VERSION_CODE="1"
#ANDROID_VERSION_NAME="1.0"

#ANDROID_KEY_STORE="../release-key.keystore"
#ANDROID_KEY_ALIAS="release-key-alias"
#ANDROID_KEY_STORE_PASSWORD="password"
#ANDROID_KEY_ALIAS_PASSWORD="password"
#ANDROID_SIGN_APP=False

#OPENGL_GLES20_ENABLED=False

#ANDROID_NATIVE_GL_ENABLED=False

#TEXT_FILES+="*.txt|*.xml|*.json"
#IMAGE_FILES+="*.png|*.jpg|*.gif|*.bmp"
#SOUND_FILES+="*.wav|*.ogg|*.mp3|*.m4a"
#MUSIC_FILES+="*.wav|*.ogg|*.mp3|*.m4a"
#BINARY_FILES+="*.bin|*.dat"


terminal.png




and finally the cerberus error:

code_language.cerberus:
"/Users/saverio/Desktop/Cerberus/bin/transcc_macos" -target=Android_Game -config=Debug "/Users/saverio/Desktop/Cerberus/examples/mojo/devolonter/matchup/matchup.cxs"
TRANS cerberus compiler V2020-10-11
Parsing...
Semanting...
Translating...
Building...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '15.0.1'.

* 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
TRANS FAILED: Android build failed.
Done.

thanks a lot Lestroso
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
@Martin The version number VERSION_1.8.0_271-b09 is correct. It's just the full version number VERSION_MAJOR.MINOR.0_REVISION-BUILD-ID. It gets more complicated when Oracle throw beta, early access namings etc into the version number.

JDK 15 should work providing that the gradle distribution bundle is updated to one that the current Ceberus-X android gradle template is still compatible with. I've tested a few and the latest release that is still compatible is gradle-4.10.3-all.zip and only issues a warning of a couple of depreciated gradle API calls.

Things to take note of with Android Studio and JDK's:
Installing Android Studio makes life a little easier for a new user to install the required SDK's than doing a manual installation by downloading the command line tools and then spending the time figuring out how to do the basic tasks. Plus code generated via Cerberus can be added to an Android Studio project for tweaking.

The current release Android Studio has it's own embedded JDK (currently 1.8.0_242-release). During installation you can choose the embedded or set the environment variable JAVA_HOME to use the embedded or select your own. All a user has to do then to switch between different versions of a JDK is to make sure that JAVA_HOME is added to their PATH environment and update JAVA_HOME to the JDK they wish to use.

Current Oracle installs are located in /Library/Java/JavaVirtualMachines and many symbolic links associated such as /usr/bin etc tend to chain link, so removing any JRE/JDK can be a bit tedious. This mean a bit of googling is required to find information to make sure all traces of software install via packages are removed.

@Fasasoftware You did remove the old project build directory, usually identified by the Cerberus version extension .buildv2020
And you did remove the hidden .gradle cache directory that you will find in your home directory?
EDIT: You will probably may find the the mojo examples may not work correctly. Try the mojo2 version instead.
 
Last edited:

AntonM

New member
Joined
Aug 16, 2017
Messages
7
I had the same error on Windows machine. Everything worked after reinstalling Android Studio with embedded jdk.
 

Fasasoftware

New member
Joined
Oct 5, 2020
Messages
15
Dear friends,
at this point i'm very confused..
Can somebody help me with step by step to deploy for android in mac osx?(Big Sur) please can you also posts the links to downloads the required softwares fo my mac mini M1?
I would like to work with cerberus x , because i think it's very powerful...
Thank a lot in advance, Lestroso
 
Top Bottom