RAPT - Ren'Py Android Packaging Tool

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Message
Author
AnonymusSensei
Newbie
Posts: 4
Joined: Thu Apr 25, 2013 5:26 am
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#136 Post by AnonymusSensei »

PyTom wrote:Unless you're customizing things, you won't need to change the (java) package name. (And I suspect it won't work if you do.) There's no reason to have the Java package name match the android one, except perhaps to be able to import R from the right place. (And you can just do that by hand.)

What are you trying to accomplish. Add an ad library?
hmmm...

errr, yeah, you got me, tehe :">
so, you know any method for that special renpy android?? :>

*FYI, i just known eclipse just 2~3 weeks, still newbie, so i hope you can tell me clearly*

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#137 Post by PyTom »

You'd pretty much have to edit PythonActivity.java, and modify the onCreate method to add another widget to the layout.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

AnonymusSensei
Newbie
Posts: 4
Joined: Thu Apr 25, 2013 5:26 am
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#138 Post by AnonymusSensei »

PyTom wrote:You'd pretty much have to edit PythonActivity.java, and modify the onCreate method to add another widget to the layout.
hmmm yeah, i though so :)
will try latter, thanks :D

i hope RAPT will have export to java feature someday :3

Dagoth
Newbie
Posts: 1
Joined: Sat Jun 15, 2013 11:37 am
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#139 Post by Dagoth »

First off I did run into the problem you addressed here, and your fix worked.

I then kept getting this error whenever I tried to build the game:

Code: Select all

C:\rapt-6.13.11.0>android.py build mygame release

Updating build files.

Updated project.properties
Updated local.properties
Added file C:\rapt-6.13.11.0\build.xml
Updated file C:\rapt-6.13.11.0\proguard-project.txt

Creating assets directory.

Traceback (most recent call last):
  File "C:\rapt-6.13.11.0\android.py", line 66, in <module>
    main()
  File "C:\rapt-6.13.11.0\android.py", line 54, in main
    build.build(iface, args.argument[0], args.argument[1:])
  File "buildlib\build.py", line 312, in build
    build_core(iface, directory, commands)
  File "buildlib\build.py", line 258, in build_core
    os.rename(old, new)
WindowsError: [Error 5] Access is denied
So after a bit of digging and some debug output added, I found that it was erroring out when trying to rename a folder. It was generally a different folder each time. I'm guessing it was happening due to a file in the folder having just been renamed and still momentarily being locked by Windows, preventing the folder from being renamed.

I came up with a workaround fix for it which consistently works for me. On line 257 / 258 (depends on whether the additional fix above is added) of build.py I replaced this:

Code: Select all

                os.rename(old, new)
with this to make it pause for a second and then try again:

Code: Select all

                try:
                    os.rename(old, new)
                except WindowsError:
                    iface.info("Error renaming file, will try again: " + old)
                    time.sleep(1.0)
                    os.rename(old, new)
                    iface.info("Second rename attempt succeeded, continuing.")
I'm able to then complete the build and install the signed APK onto my tablet.

crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#140 Post by crimsonnight »

Hey guys, I'm having a problem building the package, this is as much as I can recover from the command prompt:

Code: Select all

-build-setup:
     [echo] Resolving Build Target for AlwaysTheSameBlueSky...-0.8...
[gettarget] Project Target:   Android 2.2
[gettarget] API level:        8
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: c:\RAPT\bin
    [mkdir] Created dir: c:\RAPT\bin\res
    [mkdir] Created dir: c:\RAPT\gen
    [mkdir] Created dir: c:\RAPT\bin\classes
     [echo] ----------
     [echo] Resolving Dependencies for AlwaysTheSameBlueSky...-0.8...
[dependency] Ordered libraries:
[dependency] C:\RAPT\android-sdk\extras\google\play_apk_expansion\downloader_lib
rary
[dependency] C:\RAPT\android-sdk\extras\google\play_licensing\library
[dependency]
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
     [echo] ----------
     [echo] Building Libraries with 'release'...

nodeps:

-set-mode-check:

-set-release-mode:

-release-obfuscation-check:
     [echo] proguard.config is ${proguard.config}

-check-env:
 [checkenv] Android SDK Tools Revision 20
 [checkenv] Installed at c:\RAPT\android-sdk

-setup:
     [echo] Project Name: library
  [gettype] Project Type: Android Library
     [echo] Switching between debug and non debug build: Deleting previous compi
lation output...

-build-setup:
     [echo] Resolving Build Target for library...
[gettarget] Project Target:   Android 4.0.3
[gettarget] API level:        15
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\RAPT\android-sdk\extras\google\play_licensing\librar
y\bin
    [mkdir] Created dir: C:\RAPT\android-sdk\extras\google\play_licensing\librar
y\bin\res
    [mkdir] Created dir: C:\RAPT\android-sdk\extras\google\play_licensing\librar
y\gen
    [mkdir] Created dir: C:\RAPT\android-sdk\extras\google\play_licensing\librar
y\bin\classes
     [echo] ----------
     [echo] Resolving Dependencies for library...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.

-pre-build:

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 19 source files to C:\RAPT\android-sdk\extras\google\play_
licensing\library\bin\classes
    [javac] Note: C:\RAPT\android-sdk\extras\google\play_licensing\library\src\c
om\google\android\vending\licensing\LicenseChecker.java uses or overrides a depr
ecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
     [echo] Creating library output jar file...
      [jar] Building jar: C:\RAPT\android-sdk\extras\google\play_licensing\libra
ry\bin\classes.jar

-post-compile:

-obfuscate:

-dex:
     [echo] Library project: do not convert bytecode...

-crunch:
   [crunch] Crunching PNG Files in source dir: C:\RAPT\android-sdk\extras\google
\play_licensing\library\res
   [crunch] To destination dir: C:\RAPT\android-sdk\extras\google\play_licensing
\library\bin\res
   [crunch] Crunched 0 PNG files to update cache

-package-resources:
     [echo] Library project: do not package resources...

-package:
     [echo] Library project: do not package apk...

-post-package:

-release-prompt-for-password:

-release-nosign:
     [echo]
[propertyfile] Creating new property file: C:\RAPT\android-sdk\extras\google\pla
y_licensing\library\bin\build.prop
[propertyfile] Updating property file: C:\RAPT\android-sdk\extras\google\play_li
censing\library\bin\build.prop
[propertyfile] Updating property file: C:\RAPT\android-sdk\extras\google\play_li
censing\library\bin\build.prop
[propertyfile] Updating property file: C:\RAPT\android-sdk\extras\google\play_li
censing\library\bin\build.prop

-release-sign:

-post-build:

release:

nodeps:

-set-mode-check:

-set-release-mode:

-release-obfuscation-check:
     [echo] proguard.config is ${proguard.config}

-check-env:
 [checkenv] Android SDK Tools Revision 20
 [checkenv] Installed at c:\RAPT\android-sdk

-setup:
     [echo] Project Name: downloader_library
  [gettype] Project Type: Android Library
     [echo] Switching between debug and non debug build: Deleting previous compi
lation output...

-build-setup:
     [echo] Resolving Build Target for downloader_library...
[gettarget] Project Target:   Android 4.0.3
[gettarget] API level:        15
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\RAPT\android-sdk\extras\google\play_apk_expansion\do
wnloader_library\bin
    [mkdir] Created dir: C:\RAPT\android-sdk\extras\google\play_apk_expansion\do
wnloader_library\bin\res
    [mkdir] Created dir: C:\RAPT\android-sdk\extras\google\play_apk_expansion\do
wnloader_library\gen
    [mkdir] Created dir: C:\RAPT\android-sdk\extras\google\play_apk_expansion\do
wnloader_library\bin\classes
     [echo] ----------
     [echo] Resolving Dependencies for downloader_library...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.

-pre-build:

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 22 source files to C:\RAPT\android-sdk\extras\google\play_
apk_expansion\downloader_library\bin\classes
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
     [echo] Creating library output jar file...
      [jar] Building jar: C:\RAPT\android-sdk\extras\google\play_apk_expansion\d
ownloader_library\bin\classes.jar

-post-compile:

-obfuscate:

-dex:
     [echo] Library project: do not convert bytecode...

-crunch:
   [crunch] Crunching PNG Files in source dir: C:\RAPT\android-sdk\extras\google
\play_apk_expansion\downloader_library\res
   [crunch] To destination dir: C:\RAPT\android-sdk\extras\google\play_apk_expan
sion\downloader_library\bin\res
   [crunch] Processing image to cache: C:\RAPT\android-sdk\extras\google\play_ap
k_expansion\downloader_library\res\drawable-hdpi\notify_panel_notification_icon_
bg.png => C:\RAPT\android-sdk\extras\google\play_apk_expansion\downloader_librar
y\bin\res\drawable-hdpi\notify_panel_notification_icon_bg.png
   [crunch]   (processed image to cache entry C:\RAPT\android-sdk\extras\google\
play_apk_expansion\downloader_library\bin\res\drawable-hdpi\notify_panel_notific
ation_icon_bg.png: 0% size of source)
   [crunch] Processing image to cache: C:\RAPT\android-sdk\extras\google\play_ap
k_expansion\downloader_library\res\drawable-mdpi\notify_panel_notification_icon_
bg.png => C:\RAPT\android-sdk\extras\google\play_apk_expansion\downloader_librar
y\bin\res\drawable-mdpi\notify_panel_notification_icon_bg.png
   [crunch]   (processed image to cache entry C:\RAPT\android-sdk\extras\google\
play_apk_expansion\downloader_library\bin\res\drawable-mdpi\notify_panel_notific
ation_icon_bg.png: 0% size of source)
   [crunch] Crunched 2 PNG files to update cache

-package-resources:
     [echo] Library project: do not package resources...

-package:
     [echo] Library project: do not package apk...

-post-package:

-release-prompt-for-password:

-release-nosign:
     [echo]
[propertyfile] Creating new property file: C:\RAPT\android-sdk\extras\google\pla
y_apk_expansion\downloader_library\bin\build.prop
[propertyfile] Updating property file: C:\RAPT\android-sdk\extras\google\play_ap
k_expansion\downloader_library\bin\build.prop
[propertyfile] Updating property file: C:\RAPT\android-sdk\extras\google\play_ap
k_expansion\downloader_library\bin\build.prop
[propertyfile] Updating property file: C:\RAPT\android-sdk\extras\google\play_ap
k_expansion\downloader_library\bin\build.prop

-release-sign:

-post-build:

release:

-pre-build:

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 25 source files to c:\RAPT\bin\classes
    [javac] c:\RAPT\src\org\renpy\android\DownloaderActivity.java:96: error: int
eger number too large: 08
    [javac]     private int fileVersion = 08;
    [javac]                               ^
    [javac] 1 error

BUILD FAILED
c:\RAPT\android-sdk\tools\ant\build.xml:680: The following error occurred while
executing this line:
c:\RAPT\android-sdk\tools\ant\build.xml:693: Compile failed; see the compiler er
ror output for details.

Total time: 4 seconds

The build seems to have failed.
Any idea what the problem is? How can I access the compiler output?

Thanks,
alwaysthesamebluesky.com

MadScientist
Newbie
Posts: 3
Joined: Mon Jun 24, 2013 1:03 pm
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#141 Post by MadScientist »

Hello, I got the same error as discussed here earlier.
When I try to launch the application on android (4.2.1) i get:

While executing init code:
File "game/options.rpy", line 274, in script
File "game/options.rpy", line 279, in python
NameError: name 'build' is not defined

I removed "## This section contains information about how to build your project into distribution files." section from my options.rpy, as suggested, rebuild and reinstall application. But I still experiencing the same problem. What i'm doing wrong?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#142 Post by PyTom »

Crimson: I think the problem is that you gave it a version like 0.8, which created a numeric version number of 08, which broke things. Try changing the numeric version number to 8 or something like that.

Mad: Are you using the latest RAPT? You'd get that error if you were using a newer game with an older RAPT.

Also, there will be a bug-fix for RAPT out in a day or two, once I finish working through some problems with the Amazon market.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#143 Post by crimsonnight »

Thank PyTom, easy fix! My only problem is, after selecting 'start game' it instantly comes up with an error lol - it says 'TypeError: set_secondary_volume(l takes exactly 2 positional arguments (3 given)', if I choose to 'Ignore' it I then get a 'JPEG loading error' which when I 'Ignore' I instantly recieve another one (this just continues) - I don't get these errors on the PC builds, do you know how to combat them? Cheers
alwaysthesamebluesky.com

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#144 Post by PyTom »

Can you show me the error?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#145 Post by crimsonnight »

Of course :)
Attachments
Screenshot_2013-06-25-12-04-20.jpg
Screenshot_2013-06-25-12-04-09.jpg
Screenshot_2013-06-25-12-04-02.jpg
alwaysthesamebluesky.com

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4085
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#146 Post by jack_norton »

For the JPEG error, that happened to me too, was enough to resave the images using JPG with progressive algorithm. Note that on my device the game was fine, was only on the user's one. A mystery but that solved it :)
follow me on Image Image Image
computer games

MadScientist
Newbie
Posts: 3
Joined: Mon Jun 24, 2013 1:03 pm
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#147 Post by MadScientist »

PyTom wrote:Crimson: I think the problem is that you gave it a version like 0.8, which created a numeric version number of 08, which broke things. Try changing the numeric version number to 8 or something like that.

Mad: Are you using the latest RAPT? You'd get that error if you were using a newer game with an older RAPT.

Also, there will be a bug-fix for RAPT out in a day or two, once I finish working through some problems with the Amazon market.
I'm using version 6.13.11.0 probably that is the issue. Ok, i wait for an updated version. Thank you ^^

User avatar
Zygrott
Newbie
Posts: 2
Joined: Tue Jun 25, 2013 12:53 pm
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#148 Post by Zygrott »

I am also having difficulty with sound in a VN on android. I have tried several variations of a volume setting call in my VN, but I always get the same error, set_secondary_volume() takes exactly 2 arguments (3 given). It is ignorable and I do not get other errors associated with sound (the files play but not at the relative volumes I wanted.) I have attached the error screen. Is there a workaround for setting sound channels with different relative volume on android devices? In an unrelated question, is there any way to access the save or log files on android?
Attachments
Screenshot_2013-06-25-11-58-57.png

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#149 Post by PyTom »

There isn't a chance to get set_secondary_volume working on Android. What I will do is stub the function out properly, so code that doesn't use it crashes.

The new RAPT (due out soonish) places saves and logs on the SD card. So that will be nice.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Zygrott
Newbie
Posts: 2
Joined: Tue Jun 25, 2013 12:53 pm
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#150 Post by Zygrott »

Is there(or will there be soon) any way to adjust the relative volume of two sound channels? Perhaps through python?

Post Reply

Who is online

Users browsing this forum: No registered users