[MERGED] Android Build in the Editor

Started by eri0o, Tue 08/02/2022 21:44:30

Previous topic - Next topic

Mehrdad

#60
Yes, it's in root directory






Android Studio 3.3.2
built on February 16, 2019
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
My official site: http://www.pershaland.com/

eri0o

So this is an older version than the one I was prepared to support, this is before the version naming changes - newer is not 4, they've abandoned that version scheme for one that reflects year (of the base Intellij version or something), stable is 2021 for example.

To be honest the best thing I can think of is to avoid any error checking in ags side at build time and rely in gradle to do it's thing. But it's error reporting is often cryptical. So maybe an option to avoid sanity checking.

I am not sure yet on what to do and come up with something that works but not breaks for others. Supporting many android studios at the pace Google is updating things it's practically a full-time job, so going with only latest version of AS was the compromise I could keep up.

Mehrdad

#62
That error is in AGS editor and not when it make build.

My official site: http://www.pershaland.com/

Crimson Wizard

@Mehrdad, have you set an actual path to android sdk in the Preferences window?

Mehrdad

Quote from: Crimson Wizard on Sun 27/02/2022 06:09:59
@Mehrdad, have you set an actual path to android sdk in the Preferences window?


Yes, Actually I get apk before. It says this message in the new version
My official site: http://www.pershaland.com/

eri0o

Sorry, just to explain, this sdkmanager.exe doesn't exist anymore, this was a previous sdkmanager that had even a graphical interface. In recent versions the sdkmanager is a Java library made of libraries under the cmdline-tools/lib or tools/lib, with an entry point file named sdkmanager.bat, that partially makes up the API. The actual files behind the sdkmanager changes between command line tools and the Android Studio command line tools.

I made everything accounting for the files and SDK installed by the latest Android Studio. The command line tools and Android Studio from Mehrdad are at least three years old... And the new versions are a bit different too, because they expect now that the user will place the directories in the right place manually. It's very tricky to assemble everything by hand, I really would prefer to not support that - I can seriously spend a lot of lines describing how to glue things together, but everything will be very brittle on each update...

Mehrdad

It's sad news for me. Google doesn't support  IP Iran at all and we can't access to last updates in Android Studio. The only way was manual SDK and so on that we could get it from our sites.
Anyway, updates don't work with VPN and VPS even and google knows them!!
Actually, I can't get apk anymore. If I found any way let you know.
My official site: http://www.pershaland.com/

eri0o

for now you can create a directory named tools at the root of your android sdk, then create a directory named bin inside it and then an empty text file there called sdkmanager.bat and it will work. I am relying on sdkmanager to update/verify installation of things, so this will work as a temporary proxy. Recap, create an empty text file in ANDROID_HOME/tools/bin/sdkmanager.bat.

I am still thinking on what to do for a prettier way... My premise was to rely on current Android Studio and docs, older versions everything was very confusing... Now it's just... Confusing.

Mehrdad

#68
I had tools directory so i made "bin" and "sdkmanager.bat" : 
E:\Archive\Softwares\android-sdk-windows\android-sdk-windows\tools\bin

And the same message in AGS editor. Where is my wrong?
My official site: http://www.pershaland.com/

eri0o

Did you actually placed the sdkmanager.bat inside the bin directory? If you did that and still get the error then show me a screenshot of your preferences tab in the Editor because there's some missing information.

Crimson Wizard

#70
@eri0o,
QuoteI am relying on sdkmanager to update/verify installation of things

May these steps be simply considered optional and skipped with a warning?
If Mehrdad had apk created earlier, does not that mean that the building itself worked? Perhaps if sdkmanager is not present, or there's another problem with it, you may simply issue a warning and try continue with building?

My guess is, there may be other potential problems there, e.g. if your script wants to install things, that requires internet connection, if I understand right. What if there's no internet connection.

Maybe it's even worth adding a user preference which tells whether perform this step, as user may want to not connect to the internet or download anything while building the game.

eri0o

#71
This is what I suggested above.

Quote from: eri0o on Sat 26/02/2022 18:15:38
To be honest the best thing I can think of is to avoid any error checking in ags side at build time and rely in gradle to do it's thing. But it's error reporting is often cryptical. So maybe an option to avoid sanity checking.

The suggested fake bat script though should bypass the checking as I mentioned, if that works than adding the suggested checks as mentioned.

But full offline build is not possible, at least once Gradle has to connect and download the Java dependencies. Only after that such offline build would be possible. So instead of going for an offline check (e.g. gradle --offline %TASK%), a separate check is needed for complying with no sdkmanager.

Currently it uses the sdkmanager location to verify that the SDK is in place. So what needs to be done is:

- add a preference option that disables sanity checking, this is easily doable.
- figure a way to not use sdkmanager to check that the SDK is in place and separate dependency installation in some way. (this is harder and may take a while)
- add another preference for turning --offline flag in gradle on with a warning that at least once it needs to be run without such option to cache dependencies (we depend currently on androidx.core). This is easy to do too.

Maybe there's some way to pack the dependencies in a jar with the runtime so instead of getting the runtime as Java files get it as a jar library, but I don't know yet how to do that, when I tried it only packed the compiled Java files and the AGS native library files, not the androidx dependencies.

Mehrdad

#72
Quote from: eri0o on Mon 28/02/2022 17:39:08
Did you actually placed the sdkmanager.bat inside the bin directory? If you did that and still get the error then show me a screenshot of your preferences tab in the Editor because there's some missing information.

Yes I did
My official site: http://www.pershaland.com/

Potajito

Hey!
This looks amazing, congrats!

I managed to build without much hassle, and everything seems to work so far BUT speech. It just doesn't play. Other audio seems fine, and looking at the apk size, everything should be there.
May this be related to what Laura said some time ago?
QuoteAlso, an interesting side effect was that in the compiled Windows version, frame-linked sounds were not playing at all. I don't know what this has to do with the changes introduced for the Android build, but I can confirm that when I compiled and ran my game with the "vanilla" AGS 3.6.0.17 Alpha 18 build, those sounds played correctly.

I don't have frame linked sounds, so I can't check that one. I'm using latest one, AGS Editor .NET (Build 3.6.0.19) ** BETA VERSION **
Cheers!

eri0o

#74
Hey, I will remove the downloads from this topic, please use the new AGS 3.6.0 releases - a new one should be available soon. I will check the speech anyhow to see if there's something missing.

Curiousity, if you go into your Compiled/Android directory, is there a speech.vox somewhere there? Probably like Compiled/Android/mygame/app/src/main/assets/speech.vox or similar?

Potajito

Quote from: eri0o on Mon 14/03/2022 16:41:46
Hey, I will remove the downloads from this topic, please use the new AGS 3.6.0 releases - a new one should be available soon. I will check the speech anyhow to see if there's something missing.

Curiousity, if you go into your Compiled/Android directory, is there a speech.vox somewhere there? Probably like Compiled/Android/mygame/app/src/main/assets/speech.vox or similar?
Yep, it's there!

eri0o

#76
Hey, I reproduce... Sorta, I don't have ANY sound... Trying to figure out what's going on here.

Edit: ok, found the bug, trying to understand how to fix it

Edit2: for now, I noted down the bug here: https://github.com/adventuregamestudio/ags/issues/1577

I am still looking into this.

Edit3: found what is wrong

Edit4: making a small fix just to see it fixes on your end too.

eri0o

@Potajito Here's an editor that has this bug adjusted in the android package, it should work if you try:

AGS-3.6.0.20-Alpha21-AndroidVoxFix.exe | AGS-3.6.0.20-Alpha21-AndroidVoxFix.zip

I don't know yet the proper way to fix it, will need to think a bit.

eri0o

#78
Hey, this issue with vox packages will be fixed in the next 3.6.0 release. :)

Edit: new release appeared: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59842.0

Crimson Wizard

Quote from: eri0o on Fri 18/03/2022 11:34:18
Hey, this issue with vox packages will be fixed in the next 3.6.0 release. :)

Temp build may be downloaded here for a test: https://cirrus-ci.com/task/5385155433988096

SMF spam blocked by CleanTalk