Author Topic: Problem with َmake apk for Android with Monkey0506 guide  (Read 4238 times)

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Hi
Regarding to this links by monkey0506 :

https://bitbucket.org/monkey0506/ags/downloads/?tab=downloads
https://github.com/monkey0506/AGS.Plugin.AndroidBuilder

I used this plugin and got an apk . But when I test it on devices I have a black screen without any error . I test it on Android 4 and 5 .
Where is my wrong?
« Last Edit: 26 Jun 2017, 08:12 by Mehrdad »

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
1) What is the total file size of the game assets? (file size of the Compiled/Data folder)
2) Are you using the OBB file that the plugin builds, or are you building the OBB file yourself?
3) Are you trying to embed the OBB file into the APK (e.g., RSA public key is blank), or load it from external storage (RSA public key is filled in)?
3a) If loading the OBB from external storage, are you certain that you've placed the OBB file in the correct location?
4) Do both of the console windows that pop-up during the Android build process show that their respective processes were successful?
User was banned for this post.

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
1) size of assets is 3MB
2) I used your plugin OBB
3) RSA public key is empty . So OBB will be embed to apk . right?
4) Yes

When I open project in Android studio it embed an OBB to project automatic.
« Last Edit: 26 Jun 2017, 14:59 by Mehrdad »

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Maybe try enabling log in the acsetup.cfg and see if there is something useful?
Log is enabled as "log=1" under "[misc]" group.
I am not sure where the log file will appear. When I tested Android port on emulator, it appeared in "ags" folder on sdcard, but since you are creating a standalone APK with your game, it may be written to game location, or somewhere else around (I do not know Android rules for this).

Also I think you need to clarify which version of AGS this Android creator plugin supports, and which version is your game made for.

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Maybe I'm wrong but it doesn't make any log.

p.s :  I use demo game of AGS 3.4 (Final version)

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
APK files are just ZIP archives. Could you open the APK with a ZIP archive tool (7-zip, etc.) and provide a list of the contents of the APK itself? Also, what is the size of the OBB file?

Also I think you need to clarify which version of AGS this Android creator plugin supports

The AndroidBuilder plugin itself requires the AGS editor version 3.4.1 (has a dependency on #354), but it should be agnostic of the actual engine version. The plugin includes prebuilt native libraries from September 2016 (when the last plugin version was published), which were from the latest 3.4.1 dev branch at that time...



I was looking over the plugin source to try and figure out what might be the problem, and I think I've figured it out. Are you using AGS 3.4 to build the APK, or do you just mean that you took the demo game project from 3.4? Despite the 3.4.1 dependency, I don't see that the plugin would actually report an error if using an earlier version. I don't recall if the AGS version was actually updated to 3.4.1 at the time, but the plugin's "RequiredAGSVersion" attribute is set to 3.4.0, and the build process itself doesn't detect if the "Compiled/Data" directory doesn't exist. Therefore, I believe the problem is simply that you're using the wrong AGS version and the plugin isn't detecting that, so you're getting an empty OBB file.
User was banned for this post.

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
The AndroidBuilder plugin was last updated in September 2016 and depends on features of AGS 3.4.1, however, the AGS version was not increased to 3.4.1 until October 2016, so the plugin (at the time it was last updated) did not have a way to detect the proper minimum AGS version. However, it could also be updated to have a formal dependency on the game data file itself (e.g., Compiled/Data/GameName.ags), which it currently doesn't have. I will push an update to the plugin, but please make sure you are using AGS 3.4.1 (or later, for you future readers!).

P.S. The dependency on 3.4.1 is mentioned in the plugin's README Prerequisites section. :=
« Last Edit: 26 Jun 2017, 17:50 by monkey0506 »
User was banned for this post.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
I do not know if that is safe to use AGS 3.4.1 engine (port) right away, because after the changes I made to OpenGL there is no guarantee it will work on mobile ports yet. This requires additional work to test and get it working.

For the instance, recently I added shaders for sprite tinting/light support in OpenGL, which was missing in earlier. For this I used a new group of functions, and I cannot even tell whether that will build and run properly on Android without including more headers or doing some modifications first.

Also, I do not build Android APK myself, and the build server has stopped working a while ago, because Nick Sonneveld did not have time to update it. So unless someone provides new APK, game built with 3.4.1 editor won't even run on Android. Games built with 3.4.0 even might have some issues if APK was made last September, because last 3.4.0 update happened in March this year.

To summ up, one would need a 3.4.1-compatible APK and OpenGL needs testing and fixing for mobile ports.
« Last Edit: 26 Jun 2017, 18:17 by Crimson Wizard »

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
I think there may be some misunderstanding as to how the AndroidBuilder plugin is working. The APK it provides depends on prebuilt native libraries (including the engine, of course), and does not do anything in the way of pulling those libraries from the editor directory... That is, WindowsBuildTarget grabs acwin.exe and LinuxBuildTarget tries to pull the Linux native engine files from the editor directory, but the AndroidBuilder plugin does not. The plugin's native libraries are packaged inside of the "template.zip" which contains a template from which an Android Studio project is created. The native libraries are contained in the libs folder inside template.zip. The end-user may later replace the extracted native libraries in the "Compiled/Android/Studio/libs" folder, but that goes beyond the plugin's scope of control.

Further, the AndroidBuilder plugin does not use the "AGS game launcher" APK in any way, so that project is unrelated.

The native libraries that are currently packaged with the AndroidBuilder plugin are from September of last year, well before you started any work on OpenGL.

Finally, the AndroidBuilder plugin is experimental and is explicitly designated as not fit for regular production releases. However, it absolutely depends on the 3.4.1 editor to work properly.

That said, a future "stable" release of the plugin would expect to be able to read prebuilt native libraries from the editor directory, but the plugin is not that far developed yet.
« Last Edit: 26 Jun 2017, 19:05 by monkey0506 »
User was banned for this post.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Hm, so is it possible to run this plugin from 3.4.1 Editor to package a game compiled in 3.4.0 Editor without changing game data itself? If something like that could be done, then it might be a workaround for now.
« Last Edit: 26 Jun 2017, 19:34 by Crimson Wizard »

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #10 on: 26 Jun 2017, 20:00 »
3.4.1 and the plugin itself are both currently in "unstable" status. If something doesn't work properly then that isn't actually much of a surprise, is it? That's the whole reason for not calling it stable. And the status of the plugin itself isn't really the concern of the AGS dev team proper, but just myself (the sole author/maintainer of the plugin). Really, this thread doesn't even belong in this forum, and should probably be merged with the plugin's thread.

P.S. I do understand the concerns about basing work off of an unstable release of AGS, don't get me wrong, but the plugin itself is still considered to be in "alpha" stage. The whole process is still very messy and potentially error prone (e.g., creating an APK with no game files if wrong AGS version is used, no compile error if building OBB or APK fails, etc.). However, there are technical reasons why 3.4.1 is needed...

Add spoiler tag for "Technical reasons:":
The "OBB" (Opaque Binary Blob) file used by the APK is required to be formatted as a FAT16 virtual drive, into which the game files are mounted. This is done by a modified version of the Android SDK's "jobb" (Java OBB) tool. The jobb tool recurses an entire directory and adds its contents to the FAT partition that it creates, thus the game's data files being moved into the Compiled/Data folder was necessary to avoid further modifying the jobb tool. Which isn't to say that that's the only reason why the files are in the Compiled/Data subdirectory -- that change does make sense in its own right and should have been done from the start, an error on my part. I just mean that since 3.4.1 is the earliest version to have the data files built into its own directory, that is the lowest supported version the plugin can use.

Regarding the modifications to the jobb tool:  The jobb tool distributed with the Android SDK is bugged in that it uses a FAT library's function to determine (from file size) which FAT partition type to use (incorrectly, I might add! It returns FAT32 for anything over 511 MB...) despite the fact that Android API's "mountObb" function requires a FAT16 partition type. The modified jobb tool that the plugin uses correctly selects a FAT16 partition type for anything under 2 GB, which is the upper limit of a FAT16 partition and also the upper limit on the expansion file (the OBB file) uploaded to the Google Play Store alongside an APK. Games over 2 GB would require an alternative approach to supplying the game assets to the end-user and cannot use the GPS expansion file.
« Last Edit: 27 Jun 2017, 06:42 by monkey0506 »
User was banned for this post.

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #11 on: 27 Jun 2017, 12:35 »
Would you mind please test my apk :
http://s9.picofile.com/file/8298985218/test.apk.html

I have black screen on mobile

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #12 on: 27 Jun 2017, 14:43 »
Right, for some reason I forgot that the engine can't load any game files from a newer AGS than itself... even though CW mentioned it above. :-[

The plugin's native libraries are out of date. I'll rebuild them and upload them somewhere, but be advised of the things CW stated above that 3.4.1 is unstable and may not work as expected.
User was banned for this post.

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #13 on: 27 Jun 2017, 17:47 »
Can you make it for last stable version (3.4.0.16) ? New version is still on beta and I'm afraid doesn't work as CW said.

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #14 on: 27 Jun 2017, 18:06 »
Did you actually build 3.4.1 and test it on Android, or you're just saying things that you don't know what they mean? The plugin depends on editor features of 3.4.1, the actual build process does not. I've explained this to you before. However, since the build server is out of date and sonneveld has completely broken the ability to build the Android libraries from Windows, there's not really much that can be done in the way of building the native libraries.
User was banned for this post.

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #15 on: 28 Jun 2017, 06:38 »
Yes I build with 3.4.1 and test it on my cellphone . I put my test apk too . There is not any reason that I want say lie to you :-\
« Last Edit: 28 Jun 2017, 06:40 by Mehrdad »

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #16 on: 28 Jun 2017, 07:43 »
Yes I build with 3.4.1

No. That's not what I asked. The 3.4.1 release you installed does not include any Android port of the engine. The plugin does. The engine that the plugin contains is out-of-date. This leaves you with two options:


1) Rebuild the Android port of 3.4.1 OR
2) Use the custom 3.4.0 editor from the plugin's downloads page (select "AndroidBuilder-Plugin.Editor.rar")

There are known issues to either approach:

1) Rebuilding the Android port is currently only possible from Linux AFAICT. The 3.4.1 branch is unstable and the Android port may not run (this has not been confirmed). If you rebuild the 3.4.1 Android port, you may encounter issues which already exist in 3.4.0, or you may encounter entirely new issues.
2) The custom 3.4.0 editor is not the same as the current 3.4.0 release (patch 4), and the two are not compatible. The custom editor is out-of-date with the 3.4.0 patch 4 release, and contains source code modifications which have been adopted into 3.4.1 (some, not all of the source code changes of 3.4.1). The Android engine port the plugin contains is from the same out-of-date version of 3.4.0, and may not be compatible with 3.4.0 patch 4. Additionally, the plugin itself is unstable, which means there may be unknown/unforeseen issues.



What you have is an APK with a game data file reporting AGS version 3.4.1 and an engine reporting AGS version 3.4.0. The engine is not able to load the game data file, which is why you get only a black screen. The error is not properly detected by the plugin nor the Android engine port (or, in the case of the latter, is not reported to the user). Even if the 3.4.0 patch 4 Android port were rebuilt, the plugin still depends on those changes from 3.4.1.

The plugin depends on the jobb tool, which recurses a directory and adds its entire contents to the OBB file. This tool cannot simply be given a list of files to add without major changes to the source of the tool, they must reside in their own, separate directory (e.g., "Compiled/Data" and not "Compiled"). Therefore there is no simple way to solve this problem at the present time. You must either use a custom build of the editor, or else you must rebuild the 3.4.1 Android port. I do not have any plans to fix the plugin to work with 3.4.0, for the reasons described here. I am actively working to try and rebuild the 3.4.1 Android port, and that is the approach that I suggest be taken moving forward, despite 3.4.1's current unstable status.
User was banned for this post.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #17 on: 28 Jun 2017, 14:53 »
Did you actually build 3.4.1 and test it on Android, or you're just saying things that you don't know what they mean?
Yes I build with 3.4.1 and test it on my cellphone . I put my test apk too . There is not any reason that I want say lie to you :-\
Yes I build with 3.4.1

No. That's not what I asked.


I can honestly say that I also did not understand the meaning of your question until now. Even though I know the situation about various version differences, but most people around here do not know such details (and probably should not). I think explaining these only makes them more confused.

I believe that a regular user simply needs a short and clear answer on two questions:
- is it possible to port a 3.4.0 game with your plugin without rebuilding it (using stable and 3.4.0-compatible engine).
- if not, is it possible to rebuild and port 3.4.1 game with your plugin, and will it work properly with 3.4.1 engine.

From what I gathered, answers to both questions is currently NO. Basically, this is where a person should stop trying and wait for further updates.
« Last Edit: 28 Jun 2017, 15:33 by Crimson Wizard »

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #18 on: 28 Jun 2017, 15:54 »
I would have to go back and investigate the plugin sources to be certain, but I think that it only extracts the prebuilt native libraries (e.g., the Android engine) if those files don't exist. So, in theory it would be entirely possible to just replace those native libraries in the "Compiled/Android/Studio" project folder and rebuild a working APK.

Part of my frustration in this comes from the fact that I've explained the entire process several times to Mehrdad, though I understand that those unseen interactions leave me sounding like a right arse in all this. The plugin itself is just one (minuscule) step further abstracted away from the osd-scourgeoftheunderworld-as Android Studio project, which explains the entirely simple deployment process. The plugin is released as version 0.0, tagged as alpha, and was last updated between build versions of AGS. "Basically, this is where a person should stop trying and wait for further updates" is pretty much the understatement of the year. The process is simple, but with building the Android port from Windows being currently impossible the barrier really falls well beyond the scope of the plugin.
User was banned for this post.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #19 on: 28 Jun 2017, 16:34 »
So, the biggest problem is building those native libraries for Android port?
Unfortunately I do not know much about whole process. I emailed Sonneveld, as I mentioned in PM, hopefully he can come and discuss these matters.
Those libraries is probably something that should not be rebuilt every time. Would it be a viable solution if Nick could upload precompiled libraries?

RickJ

  • fix'n one thing and break'n two ...
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • RickJ worked on a game that was nominated for an AGS Award!
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #20 on: 28 Jun 2017, 18:33 »
Quote
"Basically, this is where a person should stop trying and wait for further updates" is pretty much the understatement of the year.
I have been following with great interest and am waiting patiently for further updates but this made me smile. :)

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #21 on: 29 Jun 2017, 05:14 »
So, the biggest problem is building those native libraries for Android port?

He also edited the NDK build script, and I'm not certain that his modifications there work on Windows either, but I can't test it at all without the engine's native dependencies. I finally got an installation of Linux under Virtualbox running again (Debian 9 installer kept crashing, so I had to download a different distro). I should be able to rebuild the Android-native Allegro (etc.) and test the NDK build from Windows, or default to downloading the NDK for Linux and run it there.

Those libraries is probably something that should not be rebuilt every time. Would it be a viable solution if Nick could upload precompiled libraries?

Right, there's no reason that the Allegro libraries should have to be rebuilt every time the engine is rebuilt, so if they could be hosted (outside of the repo, obviously) elsewhere that would be ideal.

Quote
"Basically, this is where a person should stop trying and wait for further updates" is pretty much the understatement of the year.
I have been following with great interest and am waiting patiently for further updates but this made me smile. :)

Well... *sigh* Hopefully there will be a temporary fix soon, but the plugin will need to be kept up-to-date with regard to the Android engine files it uses or this whole problem will just resurface. What should be done is that the plugin should have a dependency that the Android engine files exist in an "Editor/Android" subdirectory, and if it can't copy the engine files from there then it can't deploy the APK. That way the engine files can be updated without having to rebuild the plugin.

The way things are now, the Android engine files are packed into "template.zip" from which a(n AGS) project-specific Android Studio project is created (including the engine files), and "template.zip" is packed inside the plugin! :/ Not very well planned out, but in my own defense it was thrown together as more of a proof-of-concept from which to move forward and is versioned as v0.0 (I'll keep shouting it 'til someone hears me! :=). The engine files aside, "template.zip" should almost never have to change though, so.... [/technical-details-rant]
« Last Edit: 29 Jun 2017, 05:29 by monkey0506 »
User was banned for this post.

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #22 on: 19 Aug 2017, 21:39 »
I overlooked a rather obvious (albeit less than ideal) workaround to make the plugin work with AGS 3.4.0, which is simply to create a shallow copy of the "Compiled" folder's contents just before running the jobb tool.

That, and reading that Android engine libraries from the editor's directory are included in v0.0.3-alpha. You need to extract "Android.zip" into "EDITOR_DIRECTORY/Android" (so, "EDITOR_DIRECTORY/Android/armeabi/libags_parallax.so", etc.). The rest should work as previously described. I apologize for not thinking of this approach sooner. (roll)
User was banned for this post.

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #23 on: 21 Aug 2017, 08:00 »
Hi . Sorry but I have black screen with new version too. Maybe my knowledge is poor and I'm wrong.

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #24 on: 21 Aug 2017, 13:10 »
Could you upload the APK so I can investigate? :-\
User was banned for this post.


monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #26 on: 22 Aug 2017, 05:54 »
I've gotten so far as to verify that I can extract your game data file from the OBB. I haven't yet had time to investigate why it isn't working. :( I will try and get back to you with further details soon.
User was banned for this post.

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #27 on: 26 Aug 2017, 05:59 »
Hi Monkey0506
Did you find time for test my apk file? Is it possible make an apk with template default AGS game ?

We haven't any PC market in Iran ( My country ). And our country is blocked for any business for Steam , GOG ,...  Instead we have a good Android market . That's why I strongly need to this port . Already I fixed Persian fonts with huge help by Crimson Wizard . And I'm waiting long time for Android port.
I'm appreciate for any help
« Last Edit: 26 Aug 2017, 06:07 by Mehrdad »

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #28 on: 26 Aug 2017, 08:43 »
I may not have time to investigate this for several weeks at least. Even if the plugin is not working, the processes it use do work. Use the jobb tool and Oceanspirit Dennis Android Studio project files available from my GitHub account. That's the best advice I can give for now.
User was banned for this post.

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #29 on: 31 Aug 2017, 08:35 »
Hi

My friend found your plugin problem. Problem is about your OBB maker . He said That made an OBB with :
https://developer.android.com/studio/command-line/jobb.html

He said that removed sa.ags from my OBB and made a new OBB with it .And replace with my OBB and works fine .

It takes some works that I haven't knowledge about it.
Monkey, Please only improve your OBB maker

Mehrdad

« Last Edit: 31 Aug 2017, 08:46 by Mehrdad »

Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #30 on: 09 Sep 2017, 15:31 »
Hey! I am having a weird button1 that does nothing, except poping a message stating "Has JDK? True and Has Android SDK? True", once pressed with the latest release. ???

Has anyone seen this before? Also I don't have Android (or Linux) available in Build on General Settings.

My system is:

Windows 10, 64-Bits
Adventure Game Studio 3.4.1-7 Beta (downloaded from here)
Android Studio Version is 2.3.3 (built on June 6, 2017)
Java is Version 8 Update 144 (build 1.8.0_144-b01)

I got the plugin from monkey0506 github, v0.0.3-alpha here.

Other than Google Chrome and Steam (but with no games), there is nothing else installed in this computer.

EDIT: Fixed it! I forgot to copy the Android/ in the AGS Editor folder. But now, I am getting build failed...

Add spoiler tag for Hidden:


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':agsEngineLibrary'.
> failed to find target with hash string 'android-24' in: C:\Users\erico\AppData\Local\Android\sdk
BUILD FAILED


EDIT2: I installed the Nougat, which is API level 24, using the SDK Manager from Android Studio -> Tools -> Android -> SDK Manager. But Now I am getting "failed to find Build Tools revision 24.0.1". From the SDK Manager-> SDK Tools, I see I have Android SDK Tools 26.0.2 installed. There's no obvious way to get the 24.0.1 SDK from there... :/

EDIT3: Installed build tools 24.0.1. Needed to find my android sdk folder in AppData, in the bin folder, used the command line sdkmanager to install the version with sdkmanager.bat build-tools;24.0.1. Here's a picture on imgur.

EDIT4: So it build correctly ONE TIME. Now it gives me an erro in the console:
Unexpected error: Invalid name.
Parameter name: name


I have no idea what's that. The only thing I did between builds was removing the RSA Key, because the first build created an APK and an OBB file, when I kinda just wanted an APK... But now even adding the key back doesn't solve my problem...

EDIT5: Ok. I deleted everything, and download my game source again, retraced the steps, left the RSA Key empty and buid the game.apk with everything in it! YEY! Except it doesn't work. I only get a black screen and the app exits...

EDIT6: Opening the Android Studio Project I understand what Mehrdad said, because I am getting the following error (using the Android Monitor):

09-10 14:17:06.776 3417-3417/com.erio.ff D/OBB_COPY: File not found exception occurred copying expansion file: /storage/emulated/0/Android/obb/com.erio.ff/main.1.com.erio.ff.obb (No such file or directory)
09-10 14:17:06.826 3417-3417/com.erio.ff D/STORAGE: Expansion file /storage/emulated/0/Android/obb/com.erio.ff/main.1.com.erio.ff.obb not found!
« Last Edit: 10 Sep 2017, 18:50 by eri0o »

Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #31 on: 12 Sep 2017, 19:00 »
Hey, if someone knows how to generate a single .APK file (no obb) and make it work, I would be very happy. Maybe I am forgetting something but I have no idea what. Also, from the engine, can I detect it's ran on Android?

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #32 on: 12 Sep 2017, 20:00 »
Also, from the engine, can I detect it's ran on Android?

If you mean "from script", there is System.OperatingSystem which should return eOSAndroid if you are running android port.

Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #33 on: 12 Sep 2017, 21:04 »
Yeah,I meant from script. Ok, if I manage to generate this APK I will use this to pretoggle my touch flag on the game - it sets the text that follow mouse to be fixed on bottom and some other minor adjustments I thought could be useful :) .

Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #34 on: 26 Dec 2017, 02:43 »
Just a small update. I added my code in the repository here.

When I ran, I get the following output (in logcat):

12-26 00:39:18.147 9283-9283/? I/art: Not late-enabling -Xcheck:jni (already on)
12-26 00:39:18.147 9283-9283/? W/art: Unexpected CPU variant for X86 using defaults: x86
12-26 00:39:18.221 9283-9283/com.mythsuntold.dungeonhands W/System: ClassLoader referenced unknown path: /data/app/com.mythsuntold.dungeonhands-1/lib/x86
12-26 00:39:18.233 9283-9283/com.mythsuntold.dungeonhands I/InstantRun: starting instant run server: is main process
12-26 00:39:18.254 9283-9283/com.mythsuntold.dungeonhands D/STORAGE_MNT: SUCCESSFULLY QUEUED
12-26 00:39:18.274 9283-9283/com.mythsuntold.dungeonhands D/PATH =: /storage/emulated/0/Android/data/com.mythsuntold.dungeonhands/files/main.3.com.mythsuntold.dungeonhands.obb
12-26 00:39:18.274 9283-9283/com.mythsuntold.dungeonhands D/STATE =: 25
12-26 00:39:18.274 9283-9283/com.mythsuntold.dungeonhands D/##: Path: /storage/emulated/0/Android/data/com.mythsuntold.dungeonhands/files/main.3.com.mythsuntold.dungeonhands.obb; state: 25
                                                               
                                                                [ 12-26 00:39:18.305  9283: 9300 D/         ]
                                                                HostConnection::get() New Host Connection established 0x9f7fd840, tid 9300
12-26 00:39:18.306 9283-9300/com.mythsuntold.dungeonhands I/OpenGLRenderer: Initialized EGL, version 1.4
12-26 00:39:18.306 9283-9300/com.mythsuntold.dungeonhands D/OpenGLRenderer: Swap behavior 1
12-26 00:39:18.306 9283-9300/com.mythsuntold.dungeonhands W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
12-26 00:39:18.306 9283-9300/com.mythsuntold.dungeonhands D/OpenGLRenderer: Swap behavior 0
12-26 00:39:18.318 9283-9300/com.mythsuntold.dungeonhands D/EGL_emulation: eglCreateContext: 0x9f79dfc0: maj 2 min 0 rcv 2
12-26 00:39:18.341 9283-9300/com.mythsuntold.dungeonhands D/EGL_emulation: eglMakeCurrent: 0x9f79dfc0: ver 2 0 (tinfo 0xab0f2660)
12-26 00:39:18.359 9283-9300/com.mythsuntold.dungeonhands D/EGL_emulation: eglMakeCurrent: 0x9f79dfc0: ver 2 0 (tinfo 0xab0f2660)
12-26 00:39:18.380 9283-9300/com.mythsuntold.dungeonhands D/EGL_emulation: eglMakeCurrent: 0x9f79dfc0: ver 2 0 (tinfo 0xab0f2660)
12-26 00:39:18.381 9283-9283/com.mythsuntold.dungeonhands W/IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection

The state==25 above means I am getting the state PERMISSION_DENIED in onObbStateChange.

Add spoiler tag for Hidden:
Code: Adventure Game Studio
  1.     protected void onCreate(Bundle savedInstanceState) {
  2.         super.onCreate(savedInstanceState);
  3.         //setContentView(R.layout.activity_main);
  4.         expansionListener = new OnObbStateChangeListener() {
  5.             @Override
  6.             public void onObbStateChange(String path, int state) {
  7.                 super.onObbStateChange(path, state);
  8.                 final StorageManager storageManager =
  9.                         (StorageManager) getApplicationContext()
  10.                                 .getSystemService(Context.STORAGE_SERVICE);
  11.                 Log.d("PATH = ", path);
  12.                 Log.d("STATE = ", state + "");
  13.                 if (state == OnObbStateChangeListener.MOUNTED) {
  14.                     String mountedPath = storageManager.getMountedObbPath(path);
  15.                     Log.d("STORAGE", "-->MOUNTED");
  16.                     startGame(new File(mountedPath, GAME_FILE_NAME).getPath());
  17.                 } else {
  18.                     Log.d("##", "Path: " + path + "; state: " + state);
  19.                 }
  20.             }
  21.         };
  22.     }

Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #35 on: 26 Dec 2017, 13:22 »
(I switched to use data folder instead of obb folder because of an API change in API23)

Edit: it appears a PERMISSION_DENIED is caused by the OBB indicating it's owned by a different package. I will try to generate it again when I am at home and see what happens.

I also remember the key string being shown as @0 instead of null by Android Studio, so two things to check!

Edit2: Ok, the error was BOTH. My command for the jobb tool was the following now:
   ~/Android/Sdk/tools/bin/jobb -d ./obb/ -o main.3.com.mythsuntold.dungeonhands.obb -pn com.mythsuntold.dungeonhands -pv 3

Also, I directly set the key to null (line 186 of MainActivity.java):

Code: Adventure Game Studio
  1. ...
  2.         if (!storageManager.isObbMounted(mainFile.getAbsolutePath())) {
  3.             if (mainFile.exists()) {
  4.                 if (storageManager.mountObb(mainFile.getAbsolutePath(), null, expansionListener))  // ..., null was key, ...
  5. ...


Now I am hiting the following error:

Code: Adventure Game Studio
  1. 12-26 19:02:53.275 4810-4810/com.mythsuntold.dungeonhands I/InstantRun: starting instant run server: is main process
  2. 12-26 19:02:53.303 4810-4810/com.mythsuntold.dungeonhands D/STORAGE_MNT: SUCCESSFULLY QUEUED
  3. 12-26 19:02:53.348 4810-4829/com.mythsuntold.dungeonhands I/OpenGLRenderer: Initialized EGL, version 1.4
  4. 12-26 19:02:53.348 4810-4829/com.mythsuntold.dungeonhands D/OpenGLRenderer: Swap behavior 1
  5. 12-26 19:02:53.349 4810-4829/com.mythsuntold.dungeonhands W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
  6. 12-26 19:02:53.349 4810-4829/com.mythsuntold.dungeonhands D/OpenGLRenderer: Swap behavior 0
  7. 12-26 19:02:53.357 4810-4829/com.mythsuntold.dungeonhands D/EGL_emulation: eglCreateContext: 0x9c63a680: maj 2 min 0 rcv 2
  8. 12-26 19:02:53.366 4810-4810/com.mythsuntold.dungeonhands D/PATH =: /storage/emulated/0/Android/data/com.mythsuntold.dungeonhands/files/main.3.com.mythsuntold.dungeonhands.obb
  9. 12-26 19:02:53.366 4810-4810/com.mythsuntold.dungeonhands D/STATE =: 1
  10. 12-26 19:02:53.367 4810-4829/com.mythsuntold.dungeonhands D/EGL_emulation: eglMakeCurrent: 0x9c63a680: ver 2 0 (tinfo 0xa617d330)
  11. 12-26 19:02:53.369 4810-4810/com.mythsuntold.dungeonhands D/STORAGE: -->MOUNTED
  12. 12-26 19:02:53.377 4810-4829/com.mythsuntold.dungeonhands D/EGL_emulation: eglMakeCurrent: 0x9c63a680: ver 2 0 (tinfo 0xa617d330)
  13. 12-26 19:02:53.429 4810-4810/com.mythsuntold.dungeonhands D/AndroidRuntime: Shutting down VM
  14. 12-26 19:02:53.432 4810-4810/com.mythsuntold.dungeonhands E/AndroidRuntime: FATAL EXCEPTION: main
  15.                                                                             Process: com.mythsuntold.dungeonhands, PID: 4810
  16.                                                                             java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.mythsuntold.dungeonhands-1/base.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.mythsuntold.dungeonhands-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.mythsuntold.dungeonhands-1/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libagsengine.so"
  17.                                                                                at java.lang.Runtime.loadLibrary0(Runtime.java:972)
  18.                                                                                 at java.lang.System.loadLibrary(System.java:1530)
  19.                                                                                 at com.bigbluecup.android.EngineGlue.<init>(EngineGlue.java:67)
  20.                                                                                 at com.bigbluecup.android.AgsEngine.onCreate(AgsEngine.java:182)
  21.                                                                                 at android.app.Activity.performCreate(Activity.java:6662)
  22.                                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
  23.                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
  24.                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
  25.                                                                                 at android.app.ActivityThread.-wrap12(ActivityThread.java)
  26.                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
  27.                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
  28.                                                                                 at android.os.Looper.loop(Looper.java:154)
  29.                                                                                 at android.app.ActivityThread.main(ActivityThread.java:6077)
  30.                                                                                 at java.lang.reflect.Method.invoke(Native Method)
  31.                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
  32.                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
  33. 12-26 19:02:59.279 4810-4819/com.mythsuntold.dungeonhands E/PowerManager: WakeLock finalized while still held: fullwakelock
  34. 12-26 19:02:59.573 4810-4819/com.mythsuntold.dungeonhands E/System: Uncaught exception thrown by finalizer
  35. 12-26 19:02:59.574 4810-4819/com.mythsuntold.dungeonhands E/System: java.lang.IllegalStateException: Binder has been finalized!
  36.                                                                         at android.os.BinderProxy.transactNative(Native Method)
  37.                                                                         at android.os.BinderProxy.transact(Binder.java:615)
  38.                                                                         at android.os.IPowerManager$Stub$Proxy.releaseWakeLock(IPowerManager.java:415)
  39.                                                                         at android.os.PowerManager$WakeLock.finalize(PowerManager.java:1164)
  40.                                                                         at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:222)
  41.                                                                         at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:209)
  42.                                                                         at java.lang.Thread.run(Thread.java:761)
  43.  
  44.  

updated my repository here.

And just for proof, this is an image where I open the native-libs.jar and find the 'missing' libagsengine.so inside of it: https://i.imgur.com/j1Hd1PM.png

no native libs in output of the Native Libs Monitor . :(


Edit3: IT'S WORKING!

https://github.com/ericoporto/mythsuntold_dungeonhands V.0.1.0

I had to add the code below inside     agsEngineLibrary.gradle under android:

Code: Adventure Game Studio
  1.     sourceSets {
  2.         main {
  3.             // let gradle pack the shared library into apk
  4.             jniLibs.srcDirs = ['jniLibs']
  5.        }
  6.     }
  7.  

I built using:
Android Studio 3.0.1
Build #AI-171.4443003, built on November 9, 2017
JRE: 1.8.0_152-release-915-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.10.0-35-generic (Ubuntu 16.04)

DOWNLOAD HERE THE APK SO FAR



I have an error saying I have to do something about midi digitpatch whatever, but audio is working! Also I need to find out why DragAndDrop doesn't work!

(I know I need to update the art one day too...)
« Last Edit: 27 Dec 2017, 01:00 by eri0o »

Mehrdad

    • I can help with animation
    •  
    • I can help with characters
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #36 on: 27 Dec 2017, 06:38 »
Great works Erio.Congrats!!. Maybe it's useful for MIDI :
http://www.adventuregamestudio.co.uk/forums/index.php?topic=53209.msg636536035#msg636536035

Sorry, my knowledge is poor for any help. Would you mind please lead me too to make apk+OBB when you get success?

selmiak

  • ǝsıɔɹǝxǝ ʞɔǝu puɐ uıɐɹq
    • I can help with play testing
    •  
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with web design
    •  
    • selmiak worked on a game that was nominated for an AGS Award!
Re: Problem with َmake apk for Android with Monkey0506 guide
« Reply #37 on: 05 Jan 2018, 11:20 »
nice.