Let's build for Android!

Started by eri0o, Mon 08/01/2018 00:35:15

Previous topic - Next topic

eri0o

>> The documentation for releasing for Android is here: README.md <<

Please in case of trouble ask here in this thread! It's possible I screwed up somewhere too, so report any problems!

Note: due to Google Play App size limits, it's important your game not be bigger than 1GB. You can put some files in the app bundle and the rest on the install time asset pack if you need it to be just a bit (100MB) bigger.

---

The information below is outdated, it was relevant for old Android port.
Spoiler


I will try to explain what I did here, questions will arise, hopefully everything can be answered here and this will allow me to generate a guide.

So first two things are important:
- Android port of the engine currently doesn't report correctly mouse.isButtonDown, so your game CAN'T BE USING THIS, use if(System.OperatingSystem == eOSAndroid) in your code to work for this.
- I am using the latest prebuilt APK as libs, those were for the previous stable version, so your game must be built with that AGS.

1. You need to install the latest Android Studio, just download and install. https://developer.android.com/studio/index.html .

2. You will also need JDK, NDK and Android SDK.

3. After installing Android Studio, download the repository I made here: https://github.com/ericoporto/mythsuntold_dungeonhands . This is my modded version of Monkey's Android Studio Project.

4. Open the folder in Android Studio.

5. Building should generate my game .apk!

6. Ok, let's make YOUR game .apk. In the folder Android Studio placed the Sdk, there is a magical tool called jobb. I use Ubuntu, and the tool is in the folder ~/Android/Sdk/tools/bin/ in my computer. If you use Windows, then it's probably in %appdata%\Local\Android\Sdk . (if someone can confirm this information, it would be awesome!). This is just so you can understand what will happen next.

7. In your game Compiled folder, there is a YOURGAMENAME.ags file. Open a cmd.exe (windows) or bash terminal (Linux/OSX). Change Directory to the folder YOURGAMENAME.ags is.

In Windows (untested!)
Code: cmd

cd YOURGAMENAME\Compiled\
mkdir obb
move YOURGAMENAME.ags obb\
%appdata%\Local\Android\Sdk\tools\bin\jobb -d \obb\ -o main.3.com.YOURSTUDIONAME.YOURGAMENAME.obb -pn com.YOURSTUDIONAME.YOURGAMENAME -pv 3

   
In Linux/OSX
Code: cmd

cd YOURGAMENAME/Compiled/
mkdir obb
mv YOURGAMENAME.ags obb/
~/Android/Sdk/tools/bin/jobb -d ./obb/ -o main.3.com.YOURSTUDIONAME.YOURGAMENAME.obb -pn com.YOURSTUDIONAME.YOURGAMENAME -pv 3


In the code above, 3 is simply the OBB version number. Every time you change the content of the OBB linked to your APK and release, you have to increase that number - and update in your Android Studio Project accordingly. Also make sure that YOURGAMENAME and YOURSTUDIONAME are correctly updated in your android studio project.

8. In the README there is a line called Setting up the project for your game. I will copy below:

-Update package name:

Open the project in Android Studio, then in the project tree navigate to app/java/com.mythsuntold.osd.scourge.
Right-click on this folder and select "Refactor -> Move...". When prompted, select "Move package 'com.mythsuntold.dungeonhands' to another package" (the default). You may receive a warning that multiple directories will be moved, select Yes. Type the parent name of your package, not the final package name (e.g., com.bigbluecup not com.bigbluecup.game), select "Refactor" and then click "Do Refactor".
Right-click on the new project folder in the project tree (e.g., com.bigbluecup.scourge) and select "Refactor -> Rename". Type the package name for your game (e.g., game), then select "Refactor" and click "Do Refactor".

Finally, delete the com.mythsuntold.dungeonhands folder.

- Update project.properties. This file contains gradle settings related to your project. The application ID, version code, and version name need to be set to match your project settings (application ID is your package name).

- Update project.xml. This file contains resources for your project. The values there are described in that file.

- Update local.static.properties. This file contains local data that should NOT be added to version control (.gitignore will ignore your changes to this file). You need to add your keystore path, alias, and passwords, and optionally the path to your copy of the AGS source (if you are rebuilding the engine native libraries). See the Java docs on keytool or use the Android Studio signing wizard to generate a keystore.

- Update private.xml. This file contains definitions for your RSA public key and an integer-array with bytes for your salt which is used by the ExpansionDownloaderService. These values are necessary if distributing your app via the Google Play Store. The RSA public key is provided in the Google Play Developer Console, and the salt bytes may be any number of values in the range [-128, 127]. You may need to upload an APK without the RSA public key first before the key is provided. That APK should not be public unless the OBB file is embedded.

- Update graphics resources (app/src/main/res). You can use the Android Asset Studio to easily generate graphics for your app, or use your preferred method. Everything in the drawable and various mipmap-* folders should be replaced with your resources.

I made this post with the intent to help Mehrdad, so please try this!
[close]

Mehrdad

Great!!!.Nice job, Thanks so much Erio. I'll try it soon ;-D
My official site: http://www.pershaland.com/

Chicky

Awesome! I've been looking for a little more hand-holding on this process after having some trouble running through Monkey's guide. Before I get stuck in, can you confirm if this works with games that were built with the latest editor build (3.4.1 December)?

Exciting stuff!

Crimson Wizard

Quote from: Chicky on Tue 09/01/2018 16:24:32can you confirm if this works with games that were built with the latest editor build (3.4.1 December)?
You cannot build 3.4.1 for Android, until I (or someone else) fix OpenGL code compilation for mobile ports. :/ (Which I hope to address very soon).

Chicky

Ah, drat. Can't win 'em all. Looking forward to that CW, your efforts with the OpenGL side of things have been very much appreciated.

Joseph DiPerla

I know nothing about OpenGL or coding, but it seems you may need to use opengl es to compile for at least android: https://developer.android.com/training/graphics/opengl/index.html

Seems like a rough task. But then again, what do I know?
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

Crimson Wizard

Quote from: Joseph DiPerla on Wed 10/01/2018 14:32:07
I know nothing about OpenGL or coding, but it seems you may need to use opengl es to compile for at least android: https://developer.android.com/training/graphics/opengl/index.html

Seems like a rough task. But then again, what do I know?

We already have OpenGL coded for Android port (otherwise it would not work at all). But I added some changes for 3.4.1 to make Tinting work (because JJS forgot to add support for that), using shaders, and now I need to find out how to make shaders work with GL ES.
Assuming that may simply be a matter of finding out correct headers and function names, so may take only couple of hours, but I need to study this first.

I keep saying "I need", although all this time I had a secret wish someone else do that, considering there were people already building Android port on their own. ;)

eri0o

CW, I still couldn't understand: is the current master branch supposed to build for Android or it should fail?

Crimson Wizard

Quote from: eri0o on Wed 10/01/2018 17:56:11
CW, I still couldn't understand: is the current master branch supposed to build for Android or it should fail?
It will fail, here is the issue ticket: https://github.com/adventuregamestudio/ags/issues/420

Basically, what we need to do is to find how shader functions (list is given in the ticket) are called in GLES, include proper headers for mobile ports and make proper "#define"s for these functions.
Well, and test that everything is working, ofc.

eri0o

#9
In Android docs I found:

https://developer.android.com/reference/android/opengl/GLES20.html

Doing ctrl+f on each thing from the issue, things look available. I don't know where are iOS docs.

Edit: android moved docs from 'development' to 'developer' and I had a mini heart attack here.

.M.M.

Nice! Can I have a question that is slightly off-topic? (hopefully just slightly :) )
Quote from: eri0o on Mon 08/01/2018 00:35:15
Android port of the engine currently doesn't report correctly mouse.isButtonDown, so your game CAN'T BE USING THIS, use if(System.OperatingSystem == eOSAndroid) in your code to work for this.
What exactly does it mean, that it's not reported correctly? I'm currently using the function in both my Android projects without a problem, have I missed something?

eri0o

I don't know how I didn't see this question.

My experience with the Android port was that isButtonDown only reports correctly once the finger is placed in the touchscreen, but then, even if the finger stays in the screen, it doesn't return true anymore - like it would when you do a mouse left click and hold. I saw that iOS Wadjet port does has this behavior - which gets rid of the mouse left click being thrown on finger hold.

This is because the Android port is designed for being able to play existing ags games, and not for making Android games.

Crimson Wizard

Quote from: Crimson Wizard on Tue 09/01/2018 16:54:18
Quote from: Chicky on Tue 09/01/2018 16:24:32can you confirm if this works with games that were built with the latest editor build (3.4.1 December)?
You cannot build 3.4.1 for Android, until I (or someone else) fix OpenGL code compilation for mobile ports. :/ (Which I hope to address very soon).


UPD: You now can.

monkey0506

Quote from: eri0o on Mon 08/01/2018 00:35:15Android\Sdk\tools\bin\jobb ...

The jobb tool distributed with the Android SDK (including latest versions) is not suitable for games over 511 MB. This won't affect most games, but it is something that should be pointed out explicitly.

Additionally, you've committed a lot of binary files into your git repo, and don't even have a .gitignore file. I appreciate the fact that you made an effort to maintain this project (or the steps described therein), but you have missed important steps that obfuscate what you did actually fix from the original git repo. FWIW, I have time and an interest in getting the original repo working, but I can't promise anything definitive as I also have other projects to revisit.

eri0o

#14
Thanks Monkey0506 . I was just trying to make something fast that could work on Windows, but I wasn't very eager to install Android Studio on it... I just used it as an alternative to your plugin for myself, on Android Studio on Linux. :/

here is a gitignore for Android Studio projects if someone ever needs one
Spoiler

.gitignore
Code: java

# Built application files
*.apk
*.ap_

# Built application middle files
/*/build/

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Signing files
.signing/

# Crashlytics configuations
com_crashlytics_export_strings.xml

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches

# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db


[close]

The creature

#15
I've been following these instructions to the best that I can, looking at getting my little project working on the Phone. I dont have any compile errors or warnings and the phone is connected via USB developer. It all builds fine and generates the APK file fine. But I have one problem. The game flashes black and then returns to the phone home screen (so the APK is duff). The app also has it's original name Dungeon Ha....

I was curious of a few things - Firstly how to change the app name - I'm guessing I've done something grossly wrong. Secondly. I couldn't use the Jobb tool as there is an error when I run it so I used Winrar? I searched that by zipping up files and in a stored compression and giving it the file extension of .obb works (though I'm not sure now). My Obb file is named: main.1.com.Game.GameGame.obb (keeping the name convention the same as the original obb file).

The files I zipped were: \Compiled\game.ags & audio.vox
Is this all that is required?

********
I managed to atleast get the app name right now changing the  android:label="" in the AndroidManifest.xml but the app sadly still doesnt load. I forgot to mention that the game is compiled using AGS 3.4.1 if that could be an issue.

Any help would be great as I feel like I'm pretty close getting it all working (Thanks to eri0o of course :) )


eri0o

Could you try using this tool instead to build th obb?

https://bitbucket.org/monkey0506/jobbifier/downloads/

In Android Studio, you can filter to read the messages only from the specified app, if you do that, you will be able to read the errors in the Android Studio console (it uses ADB). You just connect an USB cable between your PC and your Android phone and enables developer mode on the phone.

You can get latest AGS android build here:

http://www.adventuregamestudio.co.uk/forums/index.php?topic=56452.0

The creature

#17
That's great, I do have my phone linked up in developer mode via USB and it was installing the APK fine, so that's all working at least.

I also updated the AGS library with the 3.4.1 build. I was using the Steam plugin, but I made an Android version of the project and removed all the STEAM strings from the project in case that was causing issues.

The app still fails to open though, and I get an error: Session 'app': Error Launching activity. It launches now, just the screen is a solid black although it asks at the start for various permissions to access photos and things - so it's trying to work.

My obb file is: main.1.com.CompanyName.Game

I updated the project.xml
Code: ags
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- TODO: Update these values for your project -->
    <!-- app name -->
    <string name="app_name">Game</string>
    <!-- game EXE or data file name -->
    <string name="game_file_name">Game.ags</string>
    <!-- expansion file version -->
    <integer name="obbFileVersion">1</integer>
    <!-- expansion file size in bytes (long) -->
    <string name="obbFileSize">43613638</string>
    <!-- expansion file key, @null for none -->
    <string name="obbKey">@null</string>
</resources>


I never still haven't used the Jobb/jobbifier tool as I'm not sure how to use it, looking into that I know you use the command console but other than that I'm at a loss. Using ES File Explorer I can see the my obb file is on my phone in the apk.

I also noticed in the master dir - mythsuntold_dungeonhands-master/ I have a file gamecompany.game.iml with this code in it it:
Code: ags
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="mythsuntold_dungeonhands" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="java-gradle" name="Java-Gradle">
      <configuration>
        <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
        <option name="BUILDABLE" value="false" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <excludeFolder url="file://$MODULE_DIR$/.gradle" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
  </component>
</module>


does this seem correct too? The 'external.linked.project.id="mythsuntold_dungeonhands" external.' seems odd, is that fine?

I feel pretty close, just at a quandary now ???

The creature

#18
I had noticed I didn't have the NDK installed from the Android SDK Manager. So I switched than on thinking this could be the issue but it throws this warning when I try to build?

Code: ags
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android

When I uninstall the NDK all the errors vanish as you can imagine. But, as you have stated in the original post, it is a requirement.

I'm very sorry for being a such pest and cluttering this thread up. It's frustrating because I feel close to getting the app working and with the awesome work that's been done here, it's been a huge help. If I get this working I will also show my process in getting it all working. I know very little about Java and android development, it's well out of my comfort zone.

Any ideas? :( one step forward, two steps back lol

FIXED

Seems that if you install the NDK via the SDK Manager it misses a number of Toolchains folders. I manually downloaded an older zip (16b) in my case and copied the missing files into my: \AppData\Local\Android\Sdk\ndk-bundle\toolchains and that fixed the errors in the project.

Sadly the app still loads to a black screen. I tried using AGS files instead of an obb and the issue still persists so I'm now wondering if the problem lies with the project now. Maybe in the Project Structure settings? I dont know. I'm at a bit of a loss.

eri0o


With your device connected in Android Studio, selected from the list, click play to run the debugger and have your game process selected in debugable process. This will give you better messages in the logcat.



The jobbifier tool has this GUI:



On input folder write your game build path (XXXX/XXXX/GAMENAME/Compiled/Windows/) and the output under /XXX/YOUR_ANDROID_STUDIO_PROJECT/app/src/main/assets/ . Don't use password, leave as main, don't forget to write your identifier and please give the same version written in your game project in android studio.

Once you can get it running like this, a reminder that you can ship the obb and apk separately in the Google Play Console, because you can't have bigger than 100MB apks.

I don't think you have to modify that xml by hand...

I am  traveling away from home, so can't give more info now...


Mehrdad

Thanks a lot, @eriOo. Nice job!!!
My official site: http://www.pershaland.com/

robcolton

This post and the Android Studio project was very helpful! I got my game up and running on Android without a lot of effort.

However, I keep getting an error about the midi driver. My game config has midi disabled, and the Android.cfg has it set to Enabled = false. I'm not sure what I'm doing wrong here?

Anyone have any ideas?

Crimson Wizard

Quote from: robcolton on Sat 26/10/2019 18:22:09
However, I keep getting an error about the midi driver. My game config has midi disabled, and the Android.cfg has it set to Enabled = false. I'm not sure what I'm doing wrong here?

Normally if you disable MIDI it should not try to initialize.

Could you post config file and what is the error message?

Oh, and what version of engine/AGS are you using?

robcolton

Quote from: Crimson Wizard on Sat 26/10/2019 18:24:28
Quote from: robcolton on Sat 26/10/2019 18:22:09
However, I keep getting an error about the midi driver. My game config has midi disabled, and the Android.cfg has it set to Enabled = false. I'm not sure what I'm doing wrong here?

Normally if you disable MIDI it should not try to initialize.

Could you post config file and what is the error message?

Oh, and what version of engine/AGS are you using?

The error I get is:
Warning: cannot enable MIDI audio.
Problem: No compatible drivers found in the system.

I'm using AGS 3.5.0.18 (RC2) and I used the Android engine labeled 3.5.0.18 from https://cirrus-ci.com/github/adventuregamestudio/ags

My acsetup.cfg file:
Code: ags

[misc]
game_width=320
game_height=200
gamecolordepth=32
antialias=0
notruecolor=0
cachemax=131072
user_data_dir=
shared_data_dir=
titletext=Rogue by Rob Colton
[graphics]
driver=D3D9
windowed=1
screen_def=scaling
game_scale_fs=proportional
game_scale_win=max_round
filter=stdscale
vsync=0
render_at_screenres=0
[sound]
digiid=-1
midiid=0
usespeech=1
[language]
translation=
[mouse]
auto_lock=0
speed=1


My android.cfg file:
Code: ags

[misc]
config_enabled = 1
rotation = 2
translation = default
[controls]
mouse_method = 0
mouse_longclick = 0
[compatibility]
clear_cache_on_room_change = 0
[sound]
samplerate = 44100
enabled = 1
threaded = 1
cache_size = 10
[midi]
enabled = 0
preload_patches = 0
[video]
framedrop = 0
[graphics]
renderer = 0
smoothing = 0
scaling = 1
super_sampling = 0
smooth_sprites = 0
[debug]
show_fps = 0
logging = 0

robcolton

Tried it with the RC3 files in the release forum, and I'm still getting the MIDI driver error. I have it disabled in both cfg files, so I'm not sure what else to do to suppress it.

Crimson Wizard

Are you using launcher APK or created APK exclusively with your game? I am not sure how it works with the latter (where it gets config from).

eri0o

#27
If someone stumbles on this thread even more updated instructions are here: https://github.com/ericoporto/teafortwo

Other than this I can't help without seeing code. The files looks correct but my guess is you are not placing it in the correct directory.

An even more more updated Android Studio project is in the works.

robcolton

Quote from: Crimson Wizard on Thu 31/10/2019 08:59:26
Are you using launcher APK or created APK exclusively with your game? I am not sure how it works with the latter (where it gets config from).

I'm building an APK specifically for my game. It works and launches the game, which plays fine after I dismiss the MIDI driver error.

The config files are in the src/main/assets folder with the obb file.

I'll go over eri0o's updated instructions and make sure I'm not missing anything.

robcolton

#29
I got it to work!

The trick was I had to put both the android.cfg and acsetup.cfg files into the obb along with the ags file. Once I did that, no more MIDI error.

Thanks for putting together your instructions. They were invaluable in getting this working.

(That just leaves iOS to get up and running...)

Vulpes


eri0o

#31
Hi @Vulpes,

At this time I don't have much more to say than what was mentioned in the README here : https://github.com/ericoporto/teafortwo

I currently just do those when I make a game and I couldn't find the right mind space to make games in 2020 and Google did release a new major version of Android Studio - which I haven't looked up on how it affected the Tea for Two project.

At this point in time I am working on a new Android port that will use the new SDL2 backend that is being developed and should be compatible with all the latest tools from Google, which I hope will make things easier.

Potajito

Oofff! I've been trying to build this all day with no success. Even trying to build Tea for Two, I get just a black flash on the device and that's it.
In the log cat I have:
Code: ags
2021-05-19 23:36:06.638 30567-30567/com.mythsuntold.teafortwo D/OBB_COPY: File not found exception occurred copying expansion file: /storage/emulated/0/Android/obb/com.mythsuntold.teafortwo/main.8.com.mythsuntold.teafortwo.obb: open failed: ENOENT (No such file or directory)
2021-05-19 23:36:06.653 30567-30567/com.mythsuntold.teafortwo D/STORAGE: Expansion file /storage/emulated/0/Android/obb/com.mythsuntold.teafortwo/main.8.com.mythsuntold.teafortwo.obb not found!

So it looks like the app can't read the obb file. I tried placing the loose files in the assets folder to no avail, same result. I even tried a 2019 build for Android Studio, AGS 3.4 libs... Not working here :( This is in Windows and Linux. i really can't think on anything else to try.

Amir

Does anyone have the repository that Eri0o made and can send it to me? and can tell me the last instructions? All links are broken. I would like to try this method because monkey0506's plugin creates broken APK and OBB and unfortunately there is no other option.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

My repositories are useless in 2021 since Google changed requirements for playstore apps. I made a new better port for game releases, on top of sdl2 port, that should be available soon, that will read Android assets without copying, work with Play Asset Delivery, and actually run on Android 11 and 12. Once it's reviewed I will update the links. The build process is also greatly simplified.

Mehrdad

Great news Erico. Thanks so much!
My official site: http://www.pershaland.com/

Amir

Wonderful ;-D thank u. I’m so excited.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#37
@Amir, the code was merged, you can find the documentation here: Android/mygame/README.md!

so, please read and ask any questions! I will try to answer questions and improve the docs there. For now all the build will need to be from full source. I recommend using Android Studio Artic Fox (2020.3) or whatever is the latest version!

For building fully from source (including native parts), you will need to mark the following in Android Studio (see below) and also download the AGS full repository here. You will then open the mygame project in Android Studio.

Spoiler
[close]

Spoiler
[close]

Once there's a new AGS 3.6.0 release, it will be possible to use the prebuilt native! (avoiding the ndk and cmake install in Android Studio)

I and CW will probably work together to make it possible to build this project from the Editor directly (like it was in monkey plugin), but in the meanwhile, you can try the above and see if it works for you.

Potajito

Quote from: eri0o on Sun 22/08/2021 23:39:45
@Amir, the code was merged, you can find the documentation here: Android/mygame/README.md!

so, please read and ask any questions! I will try to answer questions and improve the docs there. For now all the build will need to be from full source. I recommend using Android Studio Artic Fox (2020.3) or whatever is the latest version!

For building fully from source (including native parts), you will need to mark the following in Android Studio (see below) and also download the AGS full repository here. You will then open the mygame project in Android Studio.

Spoiler
[close]

Spoiler
[close]

Once there's a new AGS 3.6.0 release, it will be possible to use the prebuilt native! (avoiding the ndk and cmake install in Android Studio)

I and CW will probably work together to make it possible to build this project from the Editor directly (like it was in monkey plugin), but in the meanwhile, you can try the above and see if it works for you.
Amazing, thanks! I'll try to build tomorrow!

eri0o

The real short version of the guide is, place your compiled game files in mygame/app/src/main/assets and click build in Android Studio and see if things work. Then read the guide for details and ask here in case of problems.  :-D

Amir

Cool, but the size of my game is 1.47 GB. Does that mean I can't build for Google Play? I don't quite understand. Is there a limited size for .aab? earlier you could upload 2 obb files so 4 GB and what about the .aab format now?
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#41
Unfortunately the absolute maximum has lowered now

- 150 MB for your Android App Bundle without the asset packs (once you add them in their directories, the AAB will include them)
- 1GB for all install-time Asset combined (which works with regular Android API)
- 512 MB for all on-demand assets (requires Play Store specific API)
- 512 MB for all fast-follow assets (requires Play Store specific API)

You can see info here or discussion here. I have not worked on on-demand and fast-follow assets - anyone else is invited to, I don't know how to work with those, it would be important to check if they break app compatibility with other stores, say if you don't use those but add a dependency to the Play Core Library and then push the app to Amazon (or other non-Google store), what will happen?

Is your game using compression for the graphics in AGS? AGS compression is very minimal but better than no compression. Do you have an estimate of what your game size breakdown is (graphics, music, voice...)? Here's a forum topic that talks about this.

You can also turn compression on in the asset pack itself and see what it does for you, but it may have a significant performance impact - or may not, you would need to try and test it for your case.

See also Managing Audio and Graphics Footprint in AGS-Manual.

Amir

QuoteIs your game using compression for the graphics in AGS? AGS compression is very minimal but better than no compression.

No, it's false. I thought it has disadvantages, so I didn't activate it. I can try it and see thereafter the game size.

QuoteThe total download size limit for all asset packs in an Android App Bundle is 2 GB.

- 150 MB for your Android App Bundle without the asset packs (once you add them in their directories, the AAB will include them)
- 1GB for all install-time Asset combined (which works with regular Android API)
- 512 MB for all on-demand assets (requires Play Store specific API)
- 512 MB for all fast-follow assets (requires Play Store specific API)

That means my game is also possible. I will read more about it and about fast-follow and on-demand, I cann't understand a word now.

Thank u.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

#43
IMHO it's also a good option to look for methods to optimize your game. Find out how much everything takes - sprites, audio, etc. There's always a way to reduce the space each of these types of resources demand.

I think in any case it's important to keep in mind that what works on PC will not necessarily work on mobile devices as-is, and may require to be adjusted.

Amir

Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

Amir, but did it ran in your device? Did it worked for you at least?

Amir

#46
Quote from: eri0o on Wed 25/08/2021 23:26:35
Amir, but did it ran in your device? Did it worked for you at least?

Not yet. That scared me off:
QuoteYou will need the following to build this project:

Android Studio
AGS engine native libraries.
A compiled AGS game (NOTE: Game must be < 1 GB total).

And I will get annoyed if it works and then I can't upload it on Google Play because of the size  ;-D but I will try it anyway.

Should I update the package name and do all updates befor I build in Android Studio, right?

And which compiled game files in the assets folder do u mean? acsetup.cfg gamename.ags somelanguage.tra? these files?
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#47
Quote from: Amir on Thu 26/08/2021 16:30:48
Should I update the package name and do all updates befor I build in Android Studio, right?

And which compiled game files in the assets folder do u mean? acsetup.cfg gamename.ags somelanguage.tra? these files?

First do this with all your files from Compiled/Data dir:

Quote from: eri0o on Mon 23/08/2021 00:18:26
The real short version of the guide is, place your compiled game files in mygame/app/src/main/assets and click build in Android Studio and see if things work. Then read the guide for details and ask here in case of problems.  :-D

If you have your phone connected, after everything is done, it will even install and boot it there!

Also, please turn on sprite compression in the Editor and check the resulting size of the spritecache.

Then you do all the other things. If you are using Android Studio Artic Fox or newer there's even an easier way of doing the other steps but for now all the steps in the README should work fine - basically, on the newest Android Studio, you can have Java package files and android app IDs that doesn't match, so in theory, once everyone has updated their tools, all those steps can be a simple one line in the gradle file.

Amir

I can't believe my eyes, after sprite compression it's 321 MB  (laugh) . I copied everything in the right place. I opened the project in Android Studio, the project must be mygame in Android folder. But i'm getting errors
Spoiler

Download https://services.gradle.org/distributions/gradle-6.5-bin.zip finished, took 21 s 516 ms (102,36 MB)
Starting Gradle Daemon...
Gradle Daemon started in 10 s 594 ms

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\F�r Android Portierung\ags-master\Android\mygame\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.internal.application']
   > Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.

* 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 3m 2s

[close]

I just wanted to open it to update package name  :-\ I don't know why it says BUILD FAILED, I didn't want to build. Do u know how to fix this? should I move the project to a different directory, to C:/ maybe? and should I add the line 'android.overridePathCheck=true' to gradle.properties file in the project directory?

It's Android Studio 4.2.2
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

In your error message there's a character my browser can't render ("F�r") in your path, my guess is it's complaining about that. Make sure that the path to the android studio project has only "normal" characters (you know, things that are on the first half of an ASCII table, [a-zA-Z0-9_] , things beyond this will not work. Also to be safe, avoid space character in these directories!

Also if you can, please use Artic Fox (latest stable version of Android Studio) instead, there's a ton of bugs that have been fixed, specially for people on Windows. The version number now changed and it's something like 2020.3.X .

CW made a release today of AGS 3.6.0 and it has Android libs pre-built that you can use to avoid building native parts.

Amir

Oh I thought I have the latest version. Ok, I will download this 2020.3.1.

QuoteCW made a release today of AGS 3.6.0 and it has Android libs pre-built that you can use to avoid building native parts.

I'm using AGS 3.4.3 so I'm using Android libs of this version or do I have to use the libs of AGS 3.6.0?
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Amir

I got the error Android\ndk\21.1.6352462 did not have a source.properties file code
in build.gradle I added
Code: ags

android
 {
   ndkVersion '21.1.6352462'
  }


Now i'm getting another error:
Spoiler

Build file 'D:\For Android Portierung\ags-master\Android\mygame\build.gradle' line: 3

A problem occurred evaluating root project 'My Game'.
> Could not find method android() for arguments [build_6shez079iib0161lxajj9t08b$_run_closure1@1ef0bb64] on root project 'My Game' of type org.gradle.api.Project.

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

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'My Game'.
   at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
   at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScriptPluginFactory.java:133)
   at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
   at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:136)
   at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
   at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
   at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
   at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:43)
   at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
   at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:250)
   at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:277)
   at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:249)
   at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
   at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
   at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
   at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:100)
   at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:250)
   at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$3(DefaultProjectStateRegistry.java:310)
   at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213)
   at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:310)
   at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:291)
   at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:249)
   at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:91)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
   at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
   at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:63)
   at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:721)
   at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:151)
   at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:41)
   at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:67)
   at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:46)
   at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:56)
   at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationFiringProjectsPreparer.java:52)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
   at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
   at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.java:40)
   at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:226)
   at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:163)
   at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:148)
   at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:124)
   at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:72)
   at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
   at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213)
   at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
   at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
   at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:56)
   at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
   at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
   at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
   at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
   at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:77)
   at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
   at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
   at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
   at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
   at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
   at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
   at org.gradle.launcher.exec.InProcessBuildActionExecuter.lambda$execute$0(InProcessBuildActionExecuter.java:54)
   at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:86)
   at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:53)
   at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)
   at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeScopeLifecycleBuildActionExecuter.java:33)
   at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:49)
   at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:32)
   at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:27)
   at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:104)
   at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
   at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:64)
   at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:37)
   at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(SessionScopeLifecycleBuildActionExecuter.java:54)
   at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67)
   at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:50)
   at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:36)
   at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
   at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
   at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
   at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
   at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
   at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
   at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
   at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
   at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
   at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
   at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
   at org.gradle.util.Swapper.swap(Swapper.java:38)
   at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
   at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
   at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
   at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
   at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
   at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
   at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method android() for arguments [build_6shez079iib0161lxajj9t08b$_run_closure1@1ef0bb64] on root project 'My Game' of type org.gradle.api.Project.
   at org.gradle.internal.metaobject.AbstractDynamicObject$CustomMissingMethodExecutionFailed.<init>(AbstractDynamicObject.java:190)
   at org.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:184)
   at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.methodMissingException(BasicScript.java:162)
   at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:167)
   at org.gradle.groovy.scripts.BasicScript.invokeMethod(BasicScript.java:84)
   at build_6shez079iib0161lxajj9t08b.run(D:\For Android Portierung\ags-master\Android\mygame\build.gradle:3)
   at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
[close]


I read it might be because of the Gradle version. I took a look in my setting, Android Gradle Plugin Version 4.1.2 and Gradle Version nothing. This version is very old. Should I change Android Gradle Plugin Version and Gradle Version?
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Amir

I tried again today and it worked. I mean I was able to create com.mystudioname.gamename I had to delete android {ndkVersion '21.1.6352462'} that what I added last time. I think it worked because of Windows updates that were running recently, I don't know. But when I'm trying to build APKs I'm getting 3 errors from CMake. As a precaution I downloaded the latest version of CMake cmake-3.21.2 and added its path in Windows, but that didn't help.

The errors:
Spoiler

[CXX1405] error when building with cmake using D:\For Android Portierung\ags-master\CMakeLists.txt: Build command failed.
  Error while executing process C:\CMake\cmake-3.21.2-windows-x86_64\bin\cmake.exe with arguments {-HD:\For Android Portierung\ags-master -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=19 -DANDROID_PLATFORM=android-19 -DANDROID_ABI=armeabi-v7a -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DANDROID_NDK=C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147 -DCMAKE_ANDROID_NDK=C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147 -DCMAKE_TOOLCHAIN_FILE=C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\build\cmake\android.toolchain.cmake -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\For Android Portierung\ags-master\Android\library\runtime\build\intermediates\cxx\Debug\1r4n6yv3\obj\armeabi-v7a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\For Android Portierung\ags-master\Android\library\runtime\build\intermediates\cxx\Debug\1r4n6yv3\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -BD:\For Android Portierung\ags-master\Android\library\runtime\.cxx\Debug\1r4n6yv3\armeabi-v7a -GNinja -DANDROID_APP_PLATFORM=android-16 -DANDROID_STL=c++_static}
  -- Configuring incomplete, errors occurred!
  See also "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/CMakeFiles/CMakeOutput.log".
 
  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
[close]
Spoiler

> Task :runtime:configureCMakeDebug
C/C++: debug|armeabi-v7a :CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.

> Task :runtime:configureCMakeDebug FAILED
Execution failed for task ':runtime:configureCMakeDebug'.
> [CXX1405] error when building with cmake using D:\For Android Portierung\ags-master\CMakeLists.txt: Build command failed.
  Error while executing process C:\CMake\cmake-3.21.2-windows-x86_64\bin\cmake.exe with arguments {-HD:\For Android Portierung\ags-master -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=19 -DANDROID_PLATFORM=android-19 -DANDROID_ABI=armeabi-v7a -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DANDROID_NDK=C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147 -DCMAKE_ANDROID_NDK=C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147 -DCMAKE_TOOLCHAIN_FILE=C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\build\cmake\android.toolchain.cmake -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\For Android Portierung\ags-master\Android\library\runtime\build\intermediates\cxx\Debug\1r4n6yv3\obj\armeabi-v7a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\For Android Portierung\ags-master\Android\library\runtime\build\intermediates\cxx\Debug\1r4n6yv3\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -BD:\For Android Portierung\ags-master\Android\library\runtime\.cxx\Debug\1r4n6yv3\armeabi-v7a -GNinja -DANDROID_APP_PLATFORM=android-16 -DANDROID_STL=c++_static}
  -- Configuring incomplete, errors occurred!
  See also "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/CMakeFiles/CMakeOutput.log".

* 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.
[close]
Spoiler

[CXX1405] error when building with cmake using D:\For Android Portierung\ags-master\CMakeLists.txt: Build command failed.
Error while executing process C:\CMake\cmake-3.21.2-windows-x86_64\bin\cmake.exe with arguments {-HD:\For Android Portierung\ags-master -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=19 -DANDROID_PLATFORM=android-19 -DANDROID_ABI=armeabi-v7a -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DANDROID_NDK=C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147 -DCMAKE_ANDROID_NDK=C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147 -DCMAKE_TOOLCHAIN_FILE=C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\build\cmake\android.toolchain.cmake -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\For Android Portierung\ags-master\Android\library\runtime\build\intermediates\cxx\Debug\1r4n6yv3\obj\armeabi-v7a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\For Android Portierung\ags-master\Android\library\runtime\build\intermediates\cxx\Debug\1r4n6yv3\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -BD:\For Android Portierung\ags-master\Android\library\runtime\.cxx\Debug\1r4n6yv3\armeabi-v7a -GNinja -DANDROID_APP_PLATFORM=android-16 -DANDROID_STL=c++_static}
-- Configuring incomplete, errors occurred!
See also "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/CMakeFiles/CMakeOutput.log".

CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
[close]

I think something is wrong with the CMake files in the ags-master from eri0o. Does anyone know what's wrong? And am I the only one who gets these errors? could anyone create APK file? or a bundle What ever.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

Do you have the Ninja tool installed? All these errors seem like refering to it.

The Android readme sais:
Quote
Ninja (at least 1.10.0 should be good), also needs to be added to PATH

I think you can get it here: https://ninja-build.org/

Amir

Quote from: Crimson Wizard on Sun 12/09/2021 17:24:25
Do you have the Ninja tool installed? All these errors seem like refering to it.

The Android readme sais:
Quote
Ninja (at least 1.10.0 should be good), also needs to be added to PATH

I think you can get it here: https://ninja-build.org/

Oh I didn‘t see that  :-X ok I will download it and add the location to path and see if it works, thank u.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Amir

I added ninja.exe location to my path and added CMake as well to path then changed the version number of CMake in build.gradle. I'm using 3.21.2. Now it finds the ninja but something is still wrong, when I open the project I get one error:
Spoiler

        C/C++ Configuration Problem
   TheSecretsofJesus.runtime | debug | x86
   Compiler exited with error code 1: C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe -xc --target=i686-none-linux-android19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -ID:/For\ Android\ Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/x86/_deps/sdl2_content-build/include -ID:/For\ Android\ Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/x86/_deps/sdl2_content-src/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -D_FORTIFY_SOURCE=2 -Wformat -idirafter D:/For Android Portierung/ags-mas... (show balloon)
[close]

and when I try to build APKs I get this error:
Spoiler

Execution failed for task ':runtime:buildCMakeDebug'.
> Build command failed.
Error while executing process ninja.exe with arguments {-C D:\For Android Portierung\ags-master\Android\library\runtime\.cxx\Debug\1r4n6yv3\armeabi-v7a SDL2 ags engine hidapi pe}
ninja: Entering directory `D:\For Android Portierung\ags-master\Android\library\runtime\.cxx\Debug\1r4n6yv3\armeabi-v7a'
[1/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_RLEaccel.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_RLEaccel.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_RLEaccel.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\video\SDL_RLEaccel.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_RLEaccel.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/SDL_RLEaccel.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
[2/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/timer/SDL_timer.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/timer/SDL_timer.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/timer/SDL_timer.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\timer\SDL_timer.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/timer/SDL_timer.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/timer/SDL_timer.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
[3/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/thread/SDL_thread.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/thread/SDL_thread.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/thread/SDL_thread.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\thread\SDL_thread.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/thread/SDL_thread.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/thread/SDL_thread.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
[4/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\video\SDL_blit.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/SDL_blit.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
[5/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_0.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_0.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_0.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\video\SDL_blit_0.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_0.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/SDL_blit_0.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
[6/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_1.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_1.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_1.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\video\SDL_blit_1.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_1.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/SDL_blit_1.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
ninja: build stopped: subcommand failed.

* Try:
Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
[close]


I tried refresh linked c++ projects but it didnt help. The 2 errors are related, it's still a matter of CMake and Ninja I think. Does anybody have some solution? I can't find a solution on the internet.

I can no longer see those red error messages  8-0 Before I got that last error, I fixed 2 errors.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

Hey Amir,

Instead of going this way try, closing Android Studio, and  downloading the android prebuilt libraries here first: https://github.com/adventuregamestudio/ags/releases/tag/v.3.6.0.8

It's the file named AGS-3.6.0.8-android-libs-release.zip, then just go into the project directory and extract the libraries in the directory mentioned in the README, it should be here

https://github.com/adventuregamestudio/ags/tree/master/Android/library/runtime/libs

There's a txt file there, make sure the directory looks like it's mentioned in it! Don't download the debug libraries, use the ones marked release.

If all goes well Gradle will pickup the libraries.

The idea of using Artic Fox and newer android studio is that in them you can get both CMake and ninja without installing them externally, just by ticking the option in the SDL Tools menu, for cmake and ndk sideload. Regardless, if you use the pre-built libraries, neither ndk, cmake or Ninja are needed.

Amir

Ahaaa that was my question on August 27th.

QuoteI'm using AGS 3.4.3 so I'm using Android libs of this version or do I have to use the libs of AGS 3.6.0?

QuoteThe idea of using Artic Fox and newer android studio is that in them you can get both CMake and ninja without installing them externally, just by ticking the option in the SDL Tools menu, for cmake and ndk sideload. Regardless, if you use the pre-built libraries, neither ndk, cmake or Ninja are needed.

Wow that's cool, good to know. but I've already downloaded everything, I'll leave everything as I downloaded, it doesn't do any harm I think. so I will try tomorrow the AGS-3.6.0.8-android-libs-release and let u know. Thank u. Good night.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#58
The way it works, is like this, gradle will look if there's a file libengine.so in the library/runtime/libs/arm64-v8a/ dir ( there should be one directory for each processor architecture in the zip file, all are needed). This is done in code in the build gradle here:

https://github.com/adventuregamestudio/ags/blob/bc79bb9fe1f4421f2cde15f33172a388bbe9a733/Android/library/runtime/build.gradle#L69

So no need to change anything, just extracting the libraries in this place, one directory for each architecture. Then the project will pickup the pre-built instead of rebuilding.

There has been a new AGS release now, so you can pickup the Android libraries here now: https://github.com/adventuregamestudio/ags/releases/tag/v.3.6.0.9

Once the SDL2 version of the engine is more stable these android libraries will be also linked in the forums, but for now, just pickup the 3.6.0.X releases from GitHub.

Also for reference, if anyone is reading and want to build the C++ native parts of the engine, the config to tick in Android Studio is here

Spoiler
[close]

This is not needed when using the pre-built libraries.

Crimson Wizard

Quote from: eri0o on Tue 14/09/2021 13:19:32
Once the SDL2 version of the engine is more stable these android libraries will be also linked in the forums

I started linking them in 3.6.0 thread since yesterday :)

eri0o

Ah, thanks CW! That makes it easier! :)

Amir

I did what u said eri0o and finally no red errors, I was able to create an APK file (app-debug.apk I haven't named it yet) I tried it with android 9 and 10, black screen and keeps crashing. I started everything from scratch because I did a lot of experiments with the old project but the same result, the app chrashes.

Could it be because the game's files were created by AGS 3.4.3? or because of the gradle version that I changed to 7?
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#62
Could just start from scratch, it should be


  • get source code
  • put libraries in the specified directory
  • put the game files in the asset directory

Click play -> it should run on your phone.

Which directory did you put the game files? As I mentioned in the README, for local testing through the IDE it has to be in mygame/app/src/main/assets directory.

Only after you get working there, after everything in the project is changed to have your game name and icons and you confirm it's really working, then use the other directory, because using the other directory, which is the right one for Google Play, and will require an external tool for local testing - unfortunately right now the bundletool is not integrated in Android Studio, so bundles generated by Android Studio can't be easily tested using only it's graphical interface, I expect it will be integrated in the future.

more details in Android/mygame/README.md

If the game files are in the right directory and it's still crashing, can you give a list of the name of the files placed in the directory?

Crimson Wizard

Quote from: Amir on Wed 15/09/2021 13:19:59
Could it be because the game's files were created by AGS 3.4.3?

3.6.0 engine should be capable of running 3.4.3 games.

This may be tested by placing acwin.exe from the 3.6.0 Editor download at your game's Compiled/Data folder and running that acwin.exe.

Does it display any error at the crash?

Amir

I just tried that.


but I can build my game with AGS 3.6.0 if that is the reason that the app dosn't work. As I said, The files in the Data folder, that I use in Android Studio were created by AGS 3.4.3

@eri0o I showed everything important in the video. And it dosn't run on my phone after "Play", it crashes again. What do u think where the problem is?
the file android.cfg was already there in assets

Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#65
Just to confirm, you are using this tablet here:

https://www.samsung.com/us/business/support/owners/product/galaxy-tab-a-7-0-wi-fi/

?

I have no idea why it would crash, can you attach the generated APK somewhere so I could look? From the video I can't readily identify anything - except I would start a new project without the gradle upgrade, I would use the project as it comes from the AGS repository.

Also does the crash has any message at all?
Is it happening at install time or runtime, after installing?

I also noticed you already renamed parts of the app, but from the video I can't tell if you renamed every part. It would be best to start again with the project like it comes from the AGS repository.

When using Artic Fox and newer versions of Android Studio it's not needed to rename all that stuff anymore, in old android studio it was required to match the Java package and the app package name. This is not needed anymore, I will add a brief paragraph in the README to explain this - I just need to check but I think now you just need to say the package name in the manifest and it will all workout.

Amir

Yes, or it's called exactly Galaxy Tab A (2016) but I've tried 2 other phones too.

Weird  :-\
Ok, I'll send you a message with a link.

no special message "app has ended"
runtime, after installing
Yes by hitting the green play button.


Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#67
Thanks, just send me through a PM here and I will look.

My guess is the renaming was not done fully, like if the Android Manifest was not updated to point to the Java package name after you renamed




But all the refactoring and all those steps of renaming can be skipped in the newer version of Android Studio, I just need to recheck, but I was working towards making just setting in one place (which would be here) , I need to do a recheck to see if it's all good. When I started Google hadn't shipped yet Artic Fox, so I couldn't verify.

The relevant change is mentioned here:
http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename

And then the project.properties file applies here: https://github.com/adventuregamestudio/ags/blob/master/Android/mygame/app/build.gradle#L19

I need to recheck this though because it was all very confusing. But the general idea is to avoid any text renaming beyond the basic local.static.properties and project.properties files, which can be generated by any text/ini writer and could be integrated in the Editor build process eventually.

(for now mygame/app/src/main/res/values/project.xml is also needed, but the idea to eventually move the string there to one of the properties file above)




@Amir, on you manifest it's still referencing the un-renamed java package com.mystudioname.mygamename.MainActivity but on your video, this java package is renamed for your game already.

I picked up your game and put inside an empty project just to be safe and build and run and it worked here

Spoiler
[close]

Crimson Wizard

Quote from: Amir on Wed 15/09/2021 16:50:03
I just tried that.


Yes, 3.6.0 requires SDL2.dll to work. It also has to be copied there.

Amir

Aha I see. What should I do now? Should I add this: applicationId "com.studio.myappname" ? Or should I wait until you create a new repository?
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Amir

QuoteYes, 3.6.0 requires SDL2.dll to work. It also has to be copied there.

Yes, it works now  :) but unfortunately that doesn't help with creating a working app in Android Studio.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#71
I don't know what was changed and what was not changed, I would try to start from scratch. Don't rename anything, get it working first, after it's working do any change you want.

(When a debug apk is made on Android Studio it builds for your device, because it's all that is needed when debugging locally, unfortunately my Android devices don't match your architecture, so I can't run the apk you sent to read the error messages on the logcat tab)

Amir

#72
(misunderstanding)
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

Download the project in a new folder, place the libraries in the directory, place the game files in the asset directory and hit play. Do not rename anything until you see the game launch on the device.

Amir

I misunderstood you. Ok I will try that.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Amir

#75
(yesterday before I renamed I hit play) I got the error message:
AGSNative
Loading game failed with error: Main game file not found or could not be opened. Filname: ac2game.dta..
The game files may be incomplete, corrupt or from unsupported version of AGS.

Today I tried the app but without Android Studio and it worked but too slowly and then I wanted to try to quit the game and then continue playing I quitted the game then I got the same error "AGSNative....." I have to restart the device so that it works again.

What is ac2game.dta? 

Edit: I'm trying right now again on another device.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

#76
Quote from: Amir on Thu 16/09/2021 17:21:28
(yesterday before I renamed I hit play) I got the error message:
AGSNative
Loading game failed with error: Main game file not found or could not be opened. Filname: ac2game.dta..
The game files may be incomplete, corrupt or from unsupported version of AGS.

What is ac2game.dta? 

ac2game.dta is an internal game file generated by AGS Editor, it contains basic game settings.

This error message is usually an indication that either the game is not packaged correctly, or its got corrupted somehow.
But since you are working with APK on Android, this may also mean that engine cannot read APK / AAB contents properly.

Which native libraries are you using in the end? Older engine version did not support reading game files from Android packages, which may be a cause of this error (theoretically).

Amir

Ah ok.

I'm using the libraries from AGS-3.6.0.8. without these libraries I get a lot of errors.
But you r right Crimson Wizard now I know why, while building I got a message:
your antivirus program might be impacting your build performance. Android Studio checked the following directories:.....
I excluded those directories in my Windows Security and now it works.

But the game looks awful. It wont rotate it stays vertical on the device, so small and pixelated and it runs very slow and the short sounds are not complete, u only hear half of them.
@eri0o U have the APK file u can see that. It runs by AGS engine Android port a thousand times better I haven't had those problems as far as I can remember even though Im using the same device.

(I haven't created a package yet I mean the steps move and rename)

It would be helpful if someone else tried it with Android Studio and confirmed my problems.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

Quote from: Amir on Thu 16/09/2021 19:29:04
But the game looks awful. It wont rotate it stays vertical on the device, so small and pixelated and it runs very slow and the short sounds are not complete, u only hear half of them.
@eri0o U have the APK file u can see that. It runs by AGS engine Android port a thousand times better I haven't had those problems as far as I can remember even though Im using the same device.

To clarify, when you say "it runs by engine Android port better", do you mean the universal game launcher? Because it's all the Android engine port inside. So the differences may be either in the engine's version (3.4.*? vs 3.6.0) or some settings applied to the created APK.

I'd suggest to separate problems and make a list of them, as some may be a problem in 3.6.0 engine itself, others related to the new Android port, and so on.

For example, in regards to the short sounds, I'd very much recommend checking that out with the Windows version. In general it's best to try a desktop (Windows/Linux) engine to see which of the problems persist there.

Amir

Ok,I will check it out again for security with engine Android port and also with version 3.6.0. I always wanted to try AGS 3.6.0 and have postponed it. Now its time.

Quoteit runs by engine Android port better", do you mean the universal game launcher?

Im not sure what is the universal game launcher but I mean I could rotate it to be horizontal fully on the screen therefore clean and large and much faster. Sound was bad. As if someone had knocked on the door in between, it sounded like that. But as I said, I will check it out again.

Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Amir

QuoteBut the game looks awful. It wont rotate it stays vertical on the device, so small and pixelated and it runs very slow

@eri0o
I read u can set it to full screen mode and let it rotate, it seems to be due to Android Studio. But can u tell me how I can show that device or the preview mode? I cann't find it.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#81
Just for checking, are you sure you are using the release builds of the Android libraries? The debug version will run reaaaally slow, it's not meant to be used unless you have a need for debugging AGS Native code and for some reason you are not able to build the C++ libraries yourself.

Other than this, make sure you are using a hardware accelerated renderer and about rotation, make sure you are setting the desired rotation. These are set in the android.cfg file.

Code: ags
[misc]
rotation = 0 // user can rotate
rotation = 1 // portrait
rotation = 2 // landscape


Code: ags
[graphics]
renderer = 0 // software renderer
renderer = 1 // hardware, render to screen
renderer = 2 // hardware, render to texture


These settings are the same since jjsat first wrote this config file in 2012 because the Android Player was made to keep the same settings menu. In the future the idea is to ditch this and instead use acsetup.cfg only, but this changes a lot the Settings menu and requires touch to be a thing accross all systems (which IS, but it's not configurable yet)

QuoteBut can u tell me how I can show that device or the preview mode?

I don't understand, what do you mean? In the emulator?

Spoiler
[close]

You need to go into the AVD (Android Virtual Device) manager and create an emulator for the device you want.

Spoiler
[close]

From there on just the config the phone as you want and hit next to the end.

Spoiler
[close]

Once this is done, just click play in the device you just created in the AVD manager



from there on, the ADB running on Android Studio will pickup and show it as a device available for you to run your stuff. more details here...


About sound not working I don't know, in the past there was a sound cache config in the Android and iOS devices but these are no longer used internally by the engine, but I don't think they would explain sound failing in your case...

Amir

QuoteYou need to go into the AVD (Android Virtual Device) manager and create an emulator for the device you want.

Thank u. but it doesn't matter, I will use my device becoz I enabled VT-x in my BIOS then I got the error: the emulator process for avd has terminated and I tried all solution and it dosn't work, Android Studio is full of bugs. so wherever.

Quoteyou sure you are using the release builds of the Android libraries?
Do u mean this folder: AGS-3.6.0.8-android-libs-release. Yes I am sure.
But I read some solutions to fix that. I will try them later.

rotation = 1 is already there. that means I just have to add rotation = 0 // user can rotate , right?
and add all of renderer 0, 1 and 2.

smoothing and smooth_sprites were = 0 I set them to 1 and now it's clean and no longer pixelated  :-D

But there is a big problem. The English translation doesn't work 8-0 when I change to English, only the English graphics appear but the texts are in German (default) the file English.tra doesn't appear to be recognized.

Sounds are still not complete.

Here is my android.cfg. maybe I can still change something and solve some problems?
Spoiler
Code: ags

[misc]
config_enabled = 1
rotation = 1
translation = default
[controls]
mouse_method = 0
mouse_longclick = 0
[compatibility]
clear_cache_on_room_change = 0
[sound]
samplerate = 44100
enabled = 1
threaded = 0
cache_size = 10
[midi]
enabled = 0
preload_patches = 0
[video]
framedrop = 0
[graphics]
renderer = 0
smoothing = 1
scaling = 1
super_sampling = 0
smooth_sprites = 1
[debug]
show_fps = 0
logging = 0

[close]

translation = default I shouldn't change it to English, right?

And in acsetup.cfg [language]translation= . = nothing?  (wtf) Is that normal?

(I haven't tried AGS 3.6.0 yet and haven't moved and renamed yet)
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#83
The list of properties I gave was just to explain what each value was, you should only set one value per property in the android.cfg file.

About translation, I don't really know how translation works, would need to check what files the engine looks for.

Edit: internally engine uses the AssetManager for translation so it should work, but my guess is the value you want is English and not default - not sure, maybe there's somewhere where default gets switched to English but I could not find it looking in the source code. :/

Amir

Ok, thank u. I'll try to find it out too.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

#85
Quote from: eri0o on Fri 17/09/2021 19:21:42
Edit: internally engine uses the AssetManager for translation so it should work, but my guess is the value you want is English and not default - not sure, maybe there's somewhere where default gets switched to English but I could not find it looking in the source code. :/

"default" value in config is not interpreted as real default, but as "Default.tra", which probably does not exist. To use default language you should leave the config option empty.

PS. I still suggest to test with the windows version first to see if there are any logical bugs in the new version, as it is more reliable and easier to test.
PPS. by that I mean not necessarily convert the project to 3.6.0, but use its acwin.exe + sdl2.dll to run your compiled game and see how it behaves.

Amir

Thanks for the explanation.

I saw your edit too late. But I copied the project and converted the copied project to 3.6.0. It runs well except for the sounds. it happened like it happenes on the device through Android Studio. Incomplete, you hear 80 percent of the sound. But I noticed that only the sounds that are in the script are not complete aDoor.Play();
The frame sounds dont cause any problems, they are complete.

I tried the files from Data folder from 3.6.0 in Android Studio, hoping something will be corrected, but there is no difference. The .tra file is not read and the game runs very slow including the sounds.

I started working on a new short game. Which version is the safest and can you recommend me? AGS 3.5.1 - Patch 3? Do the sounds work well there?  :)
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

Quote from: Amir on Sat 18/09/2021 14:59:08It runs well except for the sounds. it happened like it happenes on the device through Android Studio. Incomplete, you hear 80 percent of the sound. But I noticed that only the sounds that are in the script are not complete aDoor.Play();
The frame sounds dont cause any problems, they are complete.

I'd really like to document this properly, because we will have to fix this eventually. Could you send us an example sound that does not play?

Quote from: Amir on Sat 18/09/2021 14:59:08
I tried the files from Data folder from 3.6.0 in Android Studio, hoping something will be corrected, but there is no difference. The .tra file is not read and the game runs very slow including the sounds.

Do translations work in windows version?
I cannot talk about perfomance, because haven't tried the new android port alot yet. Can you tell your game resolution? Also, what happens if you run your game with older Android launcher from 3.4 or 3.5 releases (e.g. you may try using one linked to the 3.5.1 release if you've got time to test that).

Quote from: Amir on Sat 18/09/2021 14:59:08
I started working on a new short game. Which version is the safest and can you recommend me? AGS 3.5.1 - Patch 3? Do the sounds work well there?  :)

3.5.1 should be the safest of course.

Amir

#88
QuoteI'd really like to document this properly, because we will have to fix this eventually. Could you send us an example sound that does not play?

With pleasure. send an mp3 file? I only used mp3. Or should I record a video and show what it sounds like?

QuoteDo translations work in windows version?
I cannot talk about perfomance, because haven't tried the new android port alot yet. Can you tell your game resolution? Also, what happens if you run your game with older Android launcher from 3.4 or 3.5 releases (e.g. you may try using one linked to the 3.5.1 release if you've got time to test that).

resolution 1024 x 768.

Yes, translations work in windows version with AGS 3.4... and 3.5.1. it's up to Android Studio, I think a code has to be written somewhere for the translation to work.
I just tried the 3.5.1 version. Everything is going great. The sounds are all complete.

Quote3.5.1 should be the safest of course.

Thank u.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

Quote from: Amir on Sat 18/09/2021 16:32:29
QuoteI'd really like to document this properly, because we will have to fix this eventually. Could you send us an example sound that does not play?

With pleasure. send an mp3 file? I only used mp3. Or should I record a video and show what it sounds like?

Yes, I need the exact file, because I need to observe how it is processed by the engine.

Quote from: Amir on Sat 18/09/2021 16:32:29
Yes, translations work in windows version with AGS 3.4... and 3.5.1. it's up to Android Studio, I think a code has to be written somewhere for the translation to work.

I must clarify, what about 3.6.0 windows version? Because at this point we need to know if the problem is in 3.6.0 engine in general, or Android port only.

Amir

#90
Ah ok.

Edit: I sent a PM.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

In regards to the sound cutting, eri0o has opened a bug report for the sound library we are using, so it's up to them now, unless we find the mistake ourselves earlier...

Amir

Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

If you can, replace all audio for .ogg, since I can't say how long it will take for the mp3 library be fixed, test before, but the problem doesn't seem to manifest with .ogg audio.

Amir

I'm trying to get the translation done first, that is much more important, then I’ll test .ogg
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

So, do translations work on 3.6.0 desktop versions? We need a clarification that this is purely Android problem, or general 3.6.0 problem.

eri0o, I heard you have Amir's game project, does it work if you run on Windows/Linux?

Amir

Quote from: Crimson Wizard on Wed 22/09/2021 13:12:54
So, do translations work on 3.6.0 desktop versions? We need a clarification that this is purely Android problem, or general 3.6.0 problem.

eri0o, I heard you have Amir's game project, does it work if you run on Windows/Linux?

To be sure, I just tested again. Yes it's purely Android problem. Translations work on 3.6.0.9-Alpha10 desktop version.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

Quote from: Amir on Wed 22/09/2021 13:52:19
To be sure, I just tested again. Yes it's purely Android problem. Translations work on 3.6.0.9-Alpha10 desktop version.

This is interesting, does your game have any other separate files, like audio.vox and/or speech.vox, and do they seem to work fine on Android?

I think for best testing we need to use a simpliest dummy game that changes between translations and displays text, that way we ensure that no scripting or other factors interfere.

Amir

QuoteThis is interesting, does your game have any other separate files, like audio.vox and/or speech.vox, and do they seem to work fine on Android?

No, I don't have any separate files. Sorry I cann't test that.


Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

Quote from: Amir on Fri 24/09/2021 16:04:23
No, I don't have any separate files. Sorry I cann't test that.

So basically, we would need a game which has extra files outside of the main game package, like tra, vox, or even custom files to open using script commands. Then test if opening these files works.
TBH I got an impression it should work, but haven't tried myself yet.

eri0o

#100
@CrimsonWizard, I found the bug, it's here: https://github.com/adventuregamestudio/ags/blob/c3b286539df21180300c282c415c15f56d444be4/Common/core/assetmanager.cpp#L301

In the whole assetmanager resolution of things which I don't understand, after IsAssetLibDir returned true, it goes to GetAssetFromDir, and then instead of simply Opening the File Stream and being happy with it, it instead checks the file with Path::IsFile(found_file), but since it's just a pile of bytes inside of the AndroidAsset, it doesn't find anything in the directory with is file and returns false. Not sure how to solve this without throwing more ifdefs... It also will later try to get the file size for some reason and this will obviously fail too. Ideally, it would simply try to use File::OpenFile and if it fails then it would try the other things to see what's wrong...

This is why all packages works (.ags, .vox, ...) but not normal files in the directory.

But in short, there's a bug which I am not sure how to report or how to fix properly...

Edit: here's a fix that works https://github.com/adventuregamestudio/ags/compare/master...ericoporto:fix-maybe-assetmanager-android

Crimson Wizard

#101
Well, the solution is then to either provide Android implementations for these two functions (IsFile and GetFileSize) which also use AAssetManager to check inside list of their assets, or refactor our AssetManager again to work by opening file stream right away. There has been time when AssetLocation was used outside of AssetManager, but not anymore.

I guess that in the end there have to be "filesystem" functions that cover all cases depending on the platform. Right now they are just spread around too much (File, Directory, and some in Path).

EDIT: how does it work with File::FindFileCI, should not it also fail in this case?

Quote from: eri0o on Sat 25/09/2021 00:36:20
In the whole assetmanager resolution of things which I don't understand

Please tell what is causing difficulties to understand how it works, then I will add more comments.

Crimson Wizard

#102
I will probably look if it's possible to simplify the asset manager later today. In general, i think, there has to be at least 2 file functions that provide android-specific handling: "open file" and "find file ci", because existing "open file" function is meant to open a file of precise name, while "find file ci" checks for case insensitive variants too.

eri0o

ok, did you see my quick fix above?

I am a bit without free time right now, so I couldn't spend more time. :/

Crimson Wizard

#104
Quote from: eri0o on Sun 26/09/2021 10:32:21
ok, did you see my quick fix above?

Yes I've seen it. Problem is this function GetAsset* is used for two purposes: opening an asset and simply checking that one exists. I don't think that it's a good thing to open a file and a stream when you only need to test that a file is present, so either these methods have to be refactored, or there has to be an android-specific implementation for the function that tests the file (asset) presence. EDIT: OTOH, since there's a case when you need to only check the file presence, such implementation is necessary anyway.

But also my question was, what does File::FindFileCI return in this case? Because it seems like it's searching only on disk, so I'm wondering how it works on Android. Does it use case-sensitive or case-insensitive method? EDIT: How is AGS_CASE_SENSITIVE_FILESYSTEM flag is defined? I can't seem to find it anywhere, except the Makefile-defs.linux, but what about CMake scripts?...

PS. I might make a small test pr later today, containing android implementations for few more file functions, if I learn how to do them with this AAssetManager thing.

eri0o

CMake sets case insensitiveness forced here for Linux (and this is the only place):

https://github.com/adventuregamestudio/ags/blob/9887c180e10175bf8d67908d219d711f16088924/Common/CMakeLists.txt#L198

This is not currently set for Android. Is this flag needed beyond backward compatibility?

About AAssetManager, the only functions are those linked below. Some are marked with a note they don't work if the file is compressed, but I haven't tested those to confirm, I avoided those at the time of making AAssetStream because for that it felt it wasn't necessary. AAssetDir_getNextFileName is the way to list "files in dir" in Android asset manager.

https://developer.android.com/ndk/reference/group/asset

Crimson Wizard

#106
Ah. I also found that the AAssetManager reference is used incorrectly; it's being queried and added a reference on each open stream, but these references are never deleted.
According to this page you got to call DeleteGlobalRef on objects that were received with the NewGlobalRef.
This may also be seen in the SDL2 sources, where it initializes AAssetManager only once and also has a function that releases its reference.

I don't know which yet, but we need to either have similar global create/delete functions in the Common, and explicitly call them on engine start/quit, or alternatively make AAssetManager owned by the platform driver and somehow call it from the common lib.

EDIT: I did this for now: https://github.com/ivan-mogilko/ags-refactoring/commits/android--filefuncs2
where platform driver calls initialization in Common. Alternatively, can make platform driver contain AAssetmanager's reference, and only pass it into the Common.
Will investigate the AAsset functions you linked now, hopefully it's not too complicated to make it work consistently with file funcs.

... although i keep wondering why we are not using SDL2 directly, as it seems to be doing all this already. Maybe this requires moving to use its RW Ops? In which case I'd delay such transition until next version.

EDIT 2: After more thinking, I realized there's a way and sense to also simplify AGS AssetManager further, and do something similar to your proposal, where it opens a stream right away, so to avoid extra steps.


Quote from: eri0o on Mon 27/09/2021 10:58:58
CMake sets case insensitiveness forced here for Linux (and this is the only place):

https://github.com/adventuregamestudio/ags/blob/9887c180e10175bf8d67908d219d711f16088924/Common/CMakeLists.txt#L198

This is not currently set for Android. Is this flag needed beyond backward compatibility?

This is a good question. Yes, if Android is case sensitive system then it should also use case insensitive file handling, at least in 3.* branch, which is supposed to be a backward compatible, otherwise some existing games may fail on Android with the AGS player/launcher.

Also, in theory, because the engine suppose to work same way on case sensitive and insensitive systems, it may be necessary in general; for example someone has a file with lowercase name in the game, but calls it uppercase in script. That script will work on Windows, but not on Linux.
That is, unless we explicitly state that we hold no responsibility for such mistakes.

On the other hand, this case-insensitive handling currently only works when searching for existing files, but not when e.g. writing a file. If the game script writes two files which differ only by letter case, both of these may be opened on Linux, but not on Windows, where you won't be even able to create second one without overwriting first.

But this is also a question of how engine is supposed to work by design. I recall there have been already a small discussion some time in the past, but I don't remember in which forum topic. I believe for ags4 it's important to make a definitive decision on this.

Crimson Wizard

@eri0o, well in the end I did both, changed engine's AssetManager to not do unnecessary steps when opening data for reading (this might also be enough to fix this particular problem with translations), and opened a PR for additions to Android file handing (includes "findfile" implementation too): https://github.com/adventuregamestudio/ags/pull/1421

Crimson Wizard

#108
@Amir, the modified native libraries for Android may be downloaded here:
https://cirrus-ci.com/task/6279218209226752
where it sais "Artifacts" -> "libs"
if you've got time to make another test.

Amir

Quote from: Crimson Wizard on Thu 30/09/2021 23:06:15
@Amir, the modified native libraries for Android may be downloaded here:
https://cirrus-ci.com/task/6279218209226752
where it sais "Artifacts" -> "libs"
if you've got time to make another test.

I tested (the game from the 3.6.0.9 version), cool, translations work :) thank u. Sound cutting is still there. eri0o is still working on it I guess?
But it's still running very slowly. For example the sounds are out of sync with the animations, the sounds are 2 seconds faster than the animations becoz it runs slow. Is that related to Android Studio or libs(release)? 
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

FanOfHumor

Is anyone planning on making this able to create AGS apps on android easily?

Crimson Wizard

#111
Quote from: Pajama Sam on Thu 30/12/2021 06:31:41
Is anyone planning on making this able to create AGS apps on android easily?

There has been a plan for 3.6.0 to setup a game for Android in the Editor, so that it creates a package, similar to how it does for Linux now.

If I understand correctly, we have a working method now, but it still must be run by hand. So the remaining tasks are:
1) Add a Android setup menu into the Editor (like a panel where you enter necessary options for your game);
2) Make Editor run APK building.

Presumably a user will still have to install some tools on their own (Android SDK, etc); as we do not want to distribute these big programs with AGS (and maybe that is also illegal, idk).

Now, the biggest question is who is going to do this and when. I've been more focused on the engine lately, and the person who updated Android port (eri0o) is currently away busy with something. OK, he's back now.
So unless someone else does this, maybe I will be able to look into this after 3.6.0 gets into the "Beta" stage at least.

Amir

I hope u can do it. I think that's the only weakness of the AGS engine. I know some people who decided to switch to a different engine just because of the lack of Android  :(
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

Ok, so eri0o is back now, and we continue to update Android tasks, so there's some hope :).

Amir

Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

SMF spam blocked by CleanTalk