Jibble

Author Topic: Let's build for Android!  (Read 20604 times)

eri0o

Let's build for Android!
« on: 08 Jan 2018, 00:35 »
>> 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: ShowHide


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: Adventure Game Studio
  1. cd YOURGAMENAME\Compiled\
  2. mkdir obb
  3. move YOURGAMENAME.ags obb\
  4. %appdata%\Local\Android\Sdk\tools\bin\jobb -d \obb\ -o main.3.com.YOURSTUDIONAME.YOURGAMENAME.obb -pn com.YOURSTUDIONAME.YOURGAMENAME -pv 3
  5.  
   
In Linux/OSX
Code: Adventure Game Studio
  1. cd YOURGAMENAME/Compiled/
  2. mkdir obb
  3. mv YOURGAMENAME.ags obb/
  4. ~/Android/Sdk/tools/bin/jobb -d ./obb/ -o main.3.com.YOURSTUDIONAME.YOURGAMENAME.obb -pn com.YOURSTUDIONAME.YOURGAMENAME -pv 3
  5.  

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!
« Last Edit: 23 Aug 2021, 00:28 by eri0o »

Re: Let's build for Android!
« Reply #1 on: 08 Jan 2018, 06:47 »
Great!!!.Nice job, Thanks so much Erio. I'll try it soon ;-D
My official site: http://www.pershaland.ir/

Re: Let's build for Android!
« Reply #2 on: 09 Jan 2018, 16:24 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #3 on: 09 Jan 2018, 16:54 »
can 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).

Re: Let's build for Android!
« Reply #4 on: 09 Jan 2018, 17:03 »
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

  • Joseph DiPerla, Adventure Game Creator Wannabe!
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with story design
    • I can help with translating
    • I can help with voice acting
    • I can help with web design
Re: Let's build for Android!
« Reply #5 on: 10 Jan 2018, 14:32 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #6 on: 10 Jan 2018, 15:16 »
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

Re: Let's build for Android!
« Reply #7 on: 10 Jan 2018, 17:56 »
CW, I still couldn't understand: is the current master branch supposed to build for Android or it should fail?

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #8 on: 10 Jan 2018, 18:02 »
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

Re: Let's build for Android!
« Reply #9 on: 10 Jan 2018, 18:46 »
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.
« Last Edit: 14 Feb 2018, 02:39 by eri0o »

Re: Let's build for Android!
« Reply #10 on: 08 Mar 2018, 12:15 »
Nice! Can I have a question that is slightly off-topic? (hopefully just slightly :) )
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

Re: Let's build for Android!
« Reply #11 on: 06 May 2018, 23:52 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #12 on: 10 May 2018, 10:35 »
can 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

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #13 on: 06 Jun 2018, 08:07 »
Android\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

Re: Let's build for Android!
« Reply #14 on: 14 Jun 2018, 12:44 »
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: ShowHide

.gitignore
Code: Java
  1. # Built application files
  2. *.apk
  3. *.ap_
  4.  
  5. # Built application middle files
  6. /*/build/
  7.  
  8. # Files for the ART/Dalvik VM
  9. *.dex
  10.  
  11. # Java class files
  12. *.class
  13.  
  14. # Generated files
  15. bin/
  16. gen/
  17. out/
  18.  
  19. # Gradle files
  20. .gradle/
  21. build/
  22.  
  23. # Signing files
  24. .signing/
  25.  
  26. # Crashlytics configuations
  27. com_crashlytics_export_strings.xml
  28.  
  29. # Local configuration file (sdk path, etc)
  30. local.properties
  31.  
  32. # Proguard folder generated by Eclipse
  33. proguard/
  34.  
  35. # Log Files
  36. *.log
  37.  
  38. # Android Studio Navigation editor temp files
  39. .navigation/
  40.  
  41. # Android Studio captures folder
  42. captures/
  43.  
  44. # IntelliJ
  45. *.iml
  46. .idea/workspace.xml
  47. .idea/tasks.xml
  48. .idea/gradle.xml
  49. .idea/assetWizardSettings.xml
  50. .idea/dictionaries
  51. .idea/libraries
  52. .idea/caches
  53.  
  54. # Keystore files
  55. # Uncomment the following line if you do not want to check your keystore files in.
  56. *.jks
  57.  
  58. # External native build folder generated in Android Studio 2.2 and later
  59. .externalNativeBuild
  60.  
  61. # Google Services (e.g. APIs or Firebase)
  62. google-services.json
  63.  
  64. # Freeline
  65. freeline.py
  66. freeline/
  67. freeline_project_description.json
  68.  
  69. # fastlane
  70. fastlane/report.xml
  71. fastlane/Preview.html
  72. fastlane/screenshots
  73. fastlane/test_output
  74. fastlane/readme.md
  75.  
  76. # OS-specific files
  77. .DS_Store
  78. .DS_Store?
  79. ._*
  80. .Spotlight-V100
  81. .Trashes
  82. ehthumbs.db
  83. Thumbs.db
  84.  

« Last Edit: 07 Aug 2018, 01:34 by eri0o »

Re: Let's build for Android!
« Reply #15 on: 22 Oct 2018, 12:37 »
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 :) )

« Last Edit: 22 Oct 2018, 14:39 by The creature »

eri0o

Re: Let's build for Android!
« Reply #16 on: 22 Oct 2018, 23:35 »
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

Re: Let's build for Android!
« Reply #17 on: 23 Oct 2018, 10:56 »
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: Adventure Game Studio
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <resources>
  3.     <!-- TODO: Update these values for your project -->
  4.     <!-- app name -->
  5.     <string name="app_name">Game</string>
  6.     <!-- game EXE or data file name -->
  7.     <string name="game_file_name">Game.ags</string>
  8.     <!-- expansion file version -->
  9.     <integer name="obbFileVersion">1</integer>
  10.     <!-- expansion file size in bytes (long) -->
  11.     <string name="obbFileSize">43613638</string>
  12.     <!-- expansion file key, @null for none -->
  13.     <string name="obbKey">@null</string>
  14. </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: Adventure Game Studio
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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">
  3.   <component name="FacetManager">
  4.     <facet type="java-gradle" name="Java-Gradle">
  5.       <configuration>
  6.         <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
  7.         <option name="BUILDABLE" value="false" />
  8.       </configuration>
  9.     </facet>
  10.   </component>
  11.   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
  12.     <exclude-output />
  13.     <content url="file://$MODULE_DIR$">
  14.       <excludeFolder url="file://$MODULE_DIR$/.gradle" />
  15.     </content>
  16.     <orderEntry type="inheritedJdk" />
  17.     <orderEntry type="sourceFolder" forTests="false" />
  18.   </component>
  19. </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 ???
« Last Edit: 23 Oct 2018, 11:15 by The creature »

Re: Let's build for Android!
« Reply #18 on: 23 Oct 2018, 16:51 »
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: Adventure Game Studio
  1. 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.
« Last Edit: 24 Oct 2018, 10:25 by The creature »

eri0o

Re: Let's build for Android!
« Reply #19 on: 24 Oct 2018, 12:50 »

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...

eri0o

Re: Let's build for Android!
« Reply #20 on: 09 Apr 2019, 14:28 »

Re: Let's build for Android!
« Reply #21 on: 09 Apr 2019, 16:57 »
Thanks a lot, @eriOo. Nice job!!!
My official site: http://www.pershaland.ir/

Re: Let's build for Android!
« Reply #22 on: 26 Oct 2019, 18:22 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #23 on: 26 Oct 2019, 18:24 »
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?

Re: Let's build for Android!
« Reply #24 on: 26 Oct 2019, 21:41 »
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: Adventure Game Studio
  1. [misc]
  2. game_width=320
  3. game_height=200
  4. gamecolordepth=32
  5. antialias=0
  6. notruecolor=0
  7. cachemax=131072
  8. user_data_dir=
  9. shared_data_dir=
  10. titletext=Rogue by Rob Colton
  11. [graphics]
  12. driver=D3D9
  13. windowed=1
  14. screen_def=scaling
  15. game_scale_fs=proportional
  16. game_scale_win=max_round
  17. filter=stdscale
  18. vsync=0
  19. render_at_screenres=0
  20. [sound]
  21. digiid=-1
  22. midiid=0
  23. usespeech=1
  24. [language]
  25. translation=
  26. [mouse]
  27. auto_lock=0
  28. speed=1
  29.  

My android.cfg file:
Code: Adventure Game Studio
  1. [misc]
  2. config_enabled = 1
  3. rotation = 2
  4. translation = default
  5. [controls]
  6. mouse_method = 0
  7. mouse_longclick = 0
  8. [compatibility]
  9. clear_cache_on_room_change = 0
  10. [sound]
  11. samplerate = 44100
  12. enabled = 1
  13. threaded = 1
  14. cache_size = 10
  15. [midi]
  16. enabled = 0
  17. preload_patches = 0
  18. [video]
  19. framedrop = 0
  20. [graphics]
  21. renderer = 0
  22. smoothing = 0
  23. scaling = 1
  24. super_sampling = 0
  25. smooth_sprites = 0
  26. [debug]
  27. show_fps = 0
  28. logging = 0
  29.  

Re: Let's build for Android!
« Reply #25 on: 31 Oct 2019, 05:11 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #26 on: 31 Oct 2019, 08:59 »
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

Re: Let's build for Android!
« Reply #27 on: 31 Oct 2019, 11:36 »
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.
« Last Edit: 31 Oct 2019, 11:47 by eri0o »

Re: Let's build for Android!
« Reply #28 on: 31 Oct 2019, 15:35 »
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.

Re: Let's build for Android!
« Reply #29 on: 31 Oct 2019, 16:13 »
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...)
« Last Edit: 31 Oct 2019, 16:15 by robcolton »

Re: Let's build for Android!
« Reply #30 on: 22 Jan 2021, 06:27 »
Video tutorial maybe? :')

eri0o

Re: Let's build for Android!
« Reply #31 on: 22 Jan 2021, 11:17 »
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.
« Last Edit: 22 Jan 2021, 11:30 by eri0o »

Re: Let's build for Android!
« Reply #32 on: 19 May 2021, 23:44 »
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: Adventure Game Studio
  1. 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)
  2. 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.

Re: Let's build for Android!
« Reply #33 on: 05 Aug 2021, 15:49 »
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

Re: Let's build for Android!
« Reply #34 on: 12 Aug 2021, 11:21 »
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.

Re: Let's build for Android!
« Reply #35 on: 12 Aug 2021, 12:17 »
Great news Erico. Thanks so much!
My official site: http://www.pershaland.ir/

Re: Let's build for Android!
« Reply #36 on: 13 Aug 2021, 10:54 »
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

Re: Let's build for Android!
« Reply #37 on: 22 Aug 2021, 23:39 »
@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: ShowHide


Spoiler: ShowHide


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.
« Last Edit: 23 Aug 2021, 00:33 by eri0o »

Re: Let's build for Android!
« Reply #38 on: 23 Aug 2021, 00:08 »
@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: ShowHide


Spoiler: ShowHide


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

Re: Let's build for Android!
« Reply #39 on: 23 Aug 2021, 00:18 »
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

Re: Let's build for Android!
« Reply #40 on: 23 Aug 2021, 08:54 »
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

Re: Let's build for Android!
« Reply #41 on: 23 Aug 2021, 12:18 »
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.
« Last Edit: 23 Aug 2021, 14:35 by eri0o »

Re: Let's build for Android!
« Reply #42 on: 23 Aug 2021, 14:40 »
Quote
Is 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.

Quote
The 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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #43 on: 23 Aug 2021, 17:36 »
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.
« Last Edit: 23 Aug 2021, 17:48 by Crimson Wizard »

Re: Let's build for Android!
« Reply #44 on: 25 Aug 2021, 20:51 »
Okay, I will.
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

Re: Let's build for Android!
« Reply #45 on: 25 Aug 2021, 23:26 »
Amir, but did it ran in your device? Did it worked for you at least?

Re: Let's build for Android!
« Reply #46 on: 26 Aug 2021, 16:30 »
Amir, but did it ran in your device? Did it worked for you at least?

Not yet. That scared me off:
Quote
You 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?
 
« Last Edit: 26 Aug 2021, 16:33 by Amir »
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

Re: Let's build for Android!
« Reply #47 on: 26 Aug 2021, 16:45 »
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:

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.
« Last Edit: 26 Aug 2021, 16:48 by eri0o »

Re: Let's build for Android!
« Reply #48 on: 26 Aug 2021, 21:16 »
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: ShowHide

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



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

Re: Let's build for Android!
« Reply #49 on: 26 Aug 2021, 22:15 »
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.

Re: Let's build for Android!
« Reply #50 on: 27 Aug 2021, 00:43 »
Oh I thought I have the latest version. Ok, I will download this 2020.3.1.

Quote
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.

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.

Re: Let's build for Android!
« Reply #51 on: 27 Aug 2021, 13:29 »
I got the error Android\ndk\21.1.6352462 did not have a source.properties file code
in build.gradle I added
Code: Adventure Game Studio
  1. android
  2.  {
  3.    ndkVersion '21.1.6352462'
  4.  }
  5.  

Now i'm getting another error:
Spoiler: ShowHide

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.Defa ultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
   at org.gradle.configuration.DefaultScriptP luginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScriptPluginFactory.java:133)
   at org.gradle.configuration.ProjectScriptT arget.addConfiguration(ProjectScriptTarget.java:77)
   at org.gradle.configuration.DefaultScriptP luginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:136)
   at org.gradle.configuration.BuildOperation ScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.run(DefaultBuildOperationRunner.java:56)
   at org.gradle.internal.operations.DefaultB uildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
   at org.gradle.internal.operations.Unmanage dBuildOperationWrapper.runWithUnmanaged Support(UnmanagedBuildOperationWrapper.java:45)
   at org.gradle.internal.operations.DefaultB uildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
   at org.gradle.configuration.BuildOperation ScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
   at org.gradle.configuration.internal.Defau ltUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:43)
   at org.gradle.configuration.BuildOperation ScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
   at org.gradle.api.internal.project.Default ProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:250)
   at org.gradle.api.internal.project.Default ProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:277)
   at org.gradle.api.internal.project.Default ProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:249)
   at org.gradle.configuration.project.BuildS criptProcessor.execute(BuildScriptProcessor.java:42)
   at org.gradle.configuration.project.BuildS criptProcessor.execute(BuildScriptProcessor.java:26)
   at org.gradle.configuration.project.Config ureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
   at org.gradle.configuration.project.Lifecy cleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:100)
   at org.gradle.api.internal.project.Default ProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:250)
   at org.gradle.api.internal.project.Default ProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$3(DefaultProjectStateRegistry.java:310)
   at org.gradle.internal.work.DefaultWorkerL easeService.withLocks(DefaultWorkerLeaseService.java:213)
   at org.gradle.api.internal.project.Default ProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:310)
   at org.gradle.api.internal.project.Default ProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:291)
   at org.gradle.api.internal.project.Default ProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:249)
   at org.gradle.configuration.project.Lifecy cleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:91)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.run(DefaultBuildOperationRunner.java:56)
   at org.gradle.internal.operations.DefaultB uildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
   at org.gradle.internal.operations.Unmanage dBuildOperationWrapper.runWithUnmanaged Support(UnmanagedBuildOperationWrapper.java:45)
   at org.gradle.internal.operations.DefaultB uildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
   at org.gradle.configuration.project.Lifecy cleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:63)
   at org.gradle.api.internal.project.Default Project.evaluate(DefaultProject.java:721)
   at org.gradle.api.internal.project.Default Project.evaluate(DefaultProject.java:151)
   at org.gradle.execution.TaskPathProjectEva luator.configure(TaskPathProjectEvaluator.java:41)
   at org.gradle.execution.TaskPathProjectEva luator.configureHierarchy(TaskPathProjectEvaluator.java:67)
   at org.gradle.configuration.DefaultProject sPreparer.prepareProjects(DefaultProjectsPreparer.java:46)
   at org.gradle.configuration.BuildTreePrepa ringProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:56)
   at org.gradle.configuration.BuildOperation FiringProjectsPreparer$ConfigureBuild.run(BuildOperationFiringProjectsPreparer.ja va:52)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.run(DefaultBuildOperationRunner.java:56)
   at org.gradle.internal.operations.DefaultB uildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
   at org.gradle.internal.operations.Unmanage dBuildOperationWrapper.runWithUnmanaged Support(UnmanagedBuildOperationWrapper.java:45)
   at org.gradle.internal.operations.DefaultB uildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
   at org.gradle.configuration.BuildOperation FiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.ja va:40)
   at org.gradle.initialization.DefaultGradle Launcher.prepareProjects(DefaultGradleLauncher.java:226)
   at org.gradle.initialization.DefaultGradle Launcher.doClassicBuildStages(DefaultGradleLauncher.java:163)
   at org.gradle.initialization.DefaultGradle Launcher.doBuildStages(DefaultGradleLauncher.java:148)
   at org.gradle.initialization.DefaultGradle Launcher.executeTasks(DefaultGradleLauncher.java:124)
   at org.gradle.internal.invocation.GradleBu ildController$1.create(GradleBuildController.java:72)
   at org.gradle.internal.invocation.GradleBu ildController$1.create(GradleBuildController.java:67)
   at org.gradle.internal.work.DefaultWorkerL easeService.withLocks(DefaultWorkerLeaseService.java:213)
   at org.gradle.internal.invocation.GradleBu ildController.doBuild(GradleBuildController.java:67)
   at org.gradle.internal.invocation.GradleBu ildController.run(GradleBuildController.java:56)
   at org.gradle.tooling.internal.provider.ru nner.BuildModelActionRunner.run(BuildModelActionRunner.java:56)
   at org.gradle.launcher.exec.ChainingBuildA ctionRunner.run(ChainingBuildActionRunner.java:35)
   at org.gradle.launcher.exec.ChainingBuildA ctionRunner.run(ChainingBuildActionRunner.java:35)
   at org.gradle.launcher.exec.BuildOutcomeRe portingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner. java:63)
   at org.gradle.tooling.internal.provider.Va lidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
   at org.gradle.tooling.internal.provider.Fi leSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.jav a:77)
   at org.gradle.launcher.exec.BuildCompletio nNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunn er.java:41)
   at org.gradle.launcher.exec.RunAsBuildOper ationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.ja va:49)
   at org.gradle.launcher.exec.RunAsBuildOper ationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.ja va:44)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
   at org.gradle.internal.operations.DefaultB uildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
   at org.gradle.internal.operations.DefaultB uildOperationRunner.call(DefaultBuildOperationRunner.java:62)
   at org.gradle.internal.operations.DefaultB uildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
   at org.gradle.internal.operations.Unmanage dBuildOperationWrapper.callWithUnmanage dSupport(UnmanagedBuildOperationWrapper.java:54)
   at org.gradle.internal.operations.DefaultB uildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
   at org.gradle.launcher.exec.RunAsBuildOper ationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.ja va:44)
   at org.gradle.launcher.exec.InProcessBuild ActionExecuter.lambda$execute$0(InProcessBuildActionExecuter.java:54)
   at org.gradle.composite.internal.DefaultRo otBuildState.run(DefaultRootBuildState.java:86)
   at org.gradle.launcher.exec.InProcessBuild ActionExecuter.execute(InProcessBuildActionExecuter.java:53)
   at org.gradle.launcher.exec.InProcessBuild ActionExecuter.execute(InProcessBuildActionExecuter.java:29)
   at org.gradle.launcher.exec.BuildTreeScope LifecycleBuildActionExecuter.lambda$execute$0(BuildTreeScopeLifecycleBuildActionExecu ter.java:33)
   at org.gradle.internal.buildtree.BuildTree State.run(BuildTreeState.java:49)
   at org.gradle.launcher.exec.BuildTreeScope LifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecu ter.java:32)
   at org.gradle.launcher.exec.BuildTreeScope LifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecu ter.java:27)
   at org.gradle.tooling.internal.provider.Co ntinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:104)
   at org.gradle.tooling.internal.provider.Co ntinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
   at org.gradle.tooling.internal.provider.Su bscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:64)
   at org.gradle.tooling.internal.provider.Su bscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:37)
   at org.gradle.tooling.internal.provider.Se ssionScopeLifecycleBuildActionExecuter. lambda$execute$0(SessionScopeLifecycleBuildActionExecute r.java:54)
   at org.gradle.internal.session.BuildSessio nState.run(BuildSessionState.java:67)
   at org.gradle.tooling.internal.provider.Se ssionScopeLifecycleBuildActionExecuter. execute(SessionScopeLifecycleBuildActionExecute r.java:50)
   at org.gradle.tooling.internal.provider.Se ssionScopeLifecycleBuildActionExecuter. execute(SessionScopeLifecycleBuildActionExecute r.java:36)
   at org.gradle.tooling.internal.provider.Gr adleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
   at org.gradle.tooling.internal.provider.Gr adleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
   at org.gradle.tooling.internal.provider.St artParamsValidatingActionExecuter.execu te(StartParamsValidatingActionExecuter.jav a:59)
   at org.gradle.tooling.internal.provider.St artParamsValidatingActionExecuter.execu te(StartParamsValidatingActionExecuter.jav a:31)
   at org.gradle.tooling.internal.provider.Se ssionFailureReportingActionExecuter.exe cute(SessionFailureReportingActionExecuter.j ava:55)
   at org.gradle.tooling.internal.provider.Se ssionFailureReportingActionExecuter.exe cute(SessionFailureReportingActionExecuter.j ava:41)
   at org.gradle.tooling.internal.provider.Se tupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
   at org.gradle.tooling.internal.provider.Se tupLoggingActionExecuter.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.D aemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec. WatchForDisconnection.execute(WatchForDisconnection.java:39)
   at org.gradle.launcher.daemon.server.api.D aemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec. ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
   at org.gradle.launcher.daemon.server.api.D aemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec. RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
   at org.gradle.launcher.daemon.server.api.D aemonCommandExecution.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.D aemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec. LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
   at org.gradle.launcher.daemon.server.api.D aemonCommandExecution.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.D aemonCommandExecution.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.D aemonCommandExecution.proceed(DaemonCommandExecution.java:104)
   at org.gradle.launcher.daemon.server.exec. StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
   at org.gradle.launcher.daemon.server.Daemo nStateCoordinator$1.run(DaemonStateCoordinator.java:297)
   at org.gradle.internal.concurrent.Executor Policy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
   at org.gradle.internal.concurrent.ManagedE xecutorImpl$1.run(ManagedExecutorImpl.java:48)
   at org.gradle.internal.concurrent.ThreadFa ctoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.internal.metaobject.Abstract DynamicObject$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.Abstract DynamicObject$CustomMissingMethodExecutionFailed.<init>(AbstractDynamicObject.java:190)
   at org.gradle.internal.metaobject.Abstract DynamicObject.methodMissingException(AbstractDynamicObject.java:184)
   at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.methodMissingException(BasicScript.java:162)
   at org.gradle.internal.metaobject.Abstract DynamicObject.invokeMethod(AbstractDynamicObject.java:167)
   at org.gradle.groovy.scripts.BasicScript.i nvokeMethod(BasicScript.java:84)
   at build_6shez079iib0161lxajj9t08b.run(D:\For Android Portierung\ags-master\Android\mygame\build.gradle:3)
   at org.gradle.groovy.scripts.internal.Defa ultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)



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.

Re: Let's build for Android!
« Reply #52 on: 12 Sep 2021, 16:59 »
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: ShowHide

[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.

Spoiler: ShowHide

> 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.

Spoiler: ShowHide

[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.


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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #53 on: 12 Sep 2021, 17:24 »
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/

Re: Let's build for Android!
« Reply #54 on: 12 Sep 2021, 18:00 »
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.

Re: Let's build for Android!
« Reply #55 on: 13 Sep 2021, 16:11 »
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: ShowHide

        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)


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

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.



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

Re: Let's build for Android!
« Reply #56 on: 13 Sep 2021, 18:12 »
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.

Re: Let's build for Android!
« Reply #57 on: 13 Sep 2021, 23:46 »
Ahaaa that was my question on August 27th.

Quote
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?

Quote
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.

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

Re: Let's build for Android!
« Reply #58 on: 14 Sep 2021, 13:19 »
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: ShowHide


This is not needed when using the pre-built libraries.
« Last Edit: 14 Sep 2021, 13:22 by eri0o »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #59 on: 14 Sep 2021, 13:29 »
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

Re: Let's build for Android!
« Reply #60 on: 14 Sep 2021, 14:58 »
Ah, thanks CW! That makes it easier! :)

Re: Let's build for Android!
« Reply #61 on: 15 Sep 2021, 13:19 »
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

Re: Let's build for Android!
« Reply #62 on: 15 Sep 2021, 13:58 »
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?
« Last Edit: 15 Sep 2021, 14:04 by eri0o »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #63 on: 15 Sep 2021, 15:01 »
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?

Re: Let's build for Android!
« Reply #64 on: 15 Sep 2021, 16:50 »
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

Re: Let's build for Android!
« Reply #65 on: 15 Sep 2021, 17:03 »
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.
« Last Edit: 15 Sep 2021, 17:29 by eri0o »

Re: Let's build for Android!
« Reply #66 on: 15 Sep 2021, 17:35 »
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

Re: Let's build for Android!
« Reply #67 on: 15 Sep 2021, 18:02 »
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: ShowHide
« Last Edit: 15 Sep 2021, 18:34 by eri0o »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #68 on: 15 Sep 2021, 19:05 »
I just tried that.


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

Re: Let's build for Android!
« Reply #69 on: 15 Sep 2021, 19:11 »
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.

Re: Let's build for Android!
« Reply #70 on: 15 Sep 2021, 19:15 »
Quote
Yes, 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

Re: Let's build for Android!
« Reply #71 on: 15 Sep 2021, 19:38 »
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)
« Last Edit: 15 Sep 2021, 19:40 by eri0o »

Re: Let's build for Android!
« Reply #72 on: 15 Sep 2021, 20:09 »
(misunderstanding)
« Last Edit: 16 Sep 2021, 19:43 by Amir »
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

Re: Let's build for Android!
« Reply #73 on: 15 Sep 2021, 20:28 »
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.

Re: Let's build for Android!
« Reply #74 on: 15 Sep 2021, 21:05 »
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.

Re: Let's build for Android!
« Reply #75 on: 16 Sep 2021, 17:21 »
(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.
« Last Edit: 16 Sep 2021, 17:30 by Amir »
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #76 on: 16 Sep 2021, 18:16 »
(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).
« Last Edit: 16 Sep 2021, 18:19 by Crimson Wizard »

Re: Let's build for Android!
« Reply #77 on: 16 Sep 2021, 19:29 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #78 on: 16 Sep 2021, 19:41 »
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.

Re: Let's build for Android!
« Reply #79 on: 16 Sep 2021, 20:13 »
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.

Quote
it 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.

Re: Let's build for Android!
« Reply #80 on: 16 Sep 2021, 23:45 »
Quote
But 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

Re: Let's build for Android!
« Reply #81 on: 16 Sep 2021, 23:49 »
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: Adventure Game Studio
  1. [misc]
  2. rotation = 0 // user can rotate
  3. rotation = 1 // portrait
  4. rotation = 2 // landscape

Code: Adventure Game Studio
  1. [graphics]
  2. renderer = 0 // software renderer
  3. renderer = 1 // hardware, render to screen
  4. 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)

Quote
But 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: ShowHide


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

Spoiler: ShowHide


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

Spoiler: ShowHide


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...
« Last Edit: 17 Sep 2021, 00:11 by eri0o »

Re: Let's build for Android!
« Reply #82 on: 17 Sep 2021, 19:06 »
Quote
You 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.

Quote
you 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: ShowHide
Code: Adventure Game Studio
  1. [misc]
  2. config_enabled = 1
  3. rotation = 1
  4. translation = default
  5. [controls]
  6. mouse_method = 0
  7. mouse_longclick = 0
  8. [compatibility]
  9. clear_cache_on_room_change = 0
  10. [sound]
  11. samplerate = 44100
  12. enabled = 1
  13. threaded = 0
  14. cache_size = 10
  15. [midi]
  16. enabled = 0
  17. preload_patches = 0
  18. [video]
  19. framedrop = 0
  20. [graphics]
  21. renderer = 0
  22. smoothing = 1
  23. scaling = 1
  24. super_sampling = 0
  25. smooth_sprites = 1
  26. [debug]
  27. show_fps = 0
  28. logging = 0
  29.  
  30.  


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

Re: Let's build for Android!
« Reply #83 on: 17 Sep 2021, 19:21 »
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. :/
« Last Edit: 17 Sep 2021, 19:36 by eri0o »

Re: Let's build for Android!
« Reply #84 on: 18 Sep 2021, 09:38 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #85 on: 18 Sep 2021, 11:57 »
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.
« Last Edit: 18 Sep 2021, 12:22 by Crimson Wizard »

Re: Let's build for Android!
« Reply #86 on: 18 Sep 2021, 14:59 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #87 on: 18 Sep 2021, 15:34 »
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'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?

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).

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.

Re: Let's build for Android!
« Reply #88 on: 18 Sep 2021, 16:32 »
Quote
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?

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

Quote
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).

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.

Quote
3.5.1 should be the safest of course.

Thank u.
« Last Edit: 18 Sep 2021, 16:55 by Amir »
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #89 on: 18 Sep 2021, 17:17 »
Quote
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?

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.

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.

Re: Let's build for Android!
« Reply #90 on: 18 Sep 2021, 18:20 »
Ah ok.

Edit: I sent a PM.
« Last Edit: 19 Sep 2021, 08:05 by Amir »
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #91 on: 21 Sep 2021, 13:30 »
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...

Re: Let's build for Android!
« Reply #92 on: 21 Sep 2021, 20:10 »
Ok, thank u.
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

Re: Let's build for Android!
« Reply #93 on: 21 Sep 2021, 21:20 »
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.

Re: Let's build for Android!
« Reply #94 on: 22 Sep 2021, 07:26 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #95 on: 22 Sep 2021, 13:12 »
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?

Re: Let's build for Android!
« Reply #96 on: 22 Sep 2021, 13:52 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #97 on: 23 Sep 2021, 14:53 »
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.

Re: Let's build for Android!
« Reply #98 on: 24 Sep 2021, 16:04 »
Quote
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?

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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #99 on: 24 Sep 2021, 16:07 »
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

Re: Let's build for Android!
« Reply #100 on: 25 Sep 2021, 00:36 »
@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
« Last Edit: 25 Sep 2021, 01:22 by eri0o »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #101 on: 25 Sep 2021, 01:25 »
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?

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.
« Last Edit: 25 Sep 2021, 01:43 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #102 on: 26 Sep 2021, 05:54 »
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.
« Last Edit: 26 Sep 2021, 07:09 by Crimson Wizard »

eri0o

Re: Let's build for Android!
« Reply #103 on: 26 Sep 2021, 10:32 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #104 on: 26 Sep 2021, 15:06 »
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.
« Last Edit: 27 Sep 2021, 10:09 by Crimson Wizard »

eri0o

Re: Let's build for Android!
« Reply #105 on: 27 Sep 2021, 10: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?

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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #106 on: 27 Sep 2021, 23:04 »
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.


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.
« Last Edit: 29 Sep 2021, 10:22 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #107 on: 30 Sep 2021, 10:46 »
@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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #108 on: 30 Sep 2021, 23:06 »
@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.
« Last Edit: 01 Oct 2021, 01:03 by Crimson Wizard »

Re: Let's build for Android!
« Reply #109 on: 01 Oct 2021, 12:29 »
@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.