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
User avatar
PyTom
Ren'Py Creator
Posts: 16088
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

#121 Post by PyTom »

Are you sure you have the JDK, and not the JRE?

The only other thing I can think of is to try a different bitness of JDK - if you have the 32-bit JDK, install the 64-bit version, and vice versa.
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

Juny
Newbie
Posts: 23
Joined: Mon Aug 27, 2012 8:22 am
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#122 Post by Juny »

Interitum wrote:Well, can't get past Step 2.
Checked the path, attempted fixing it.
No go.
JDK exists, re-installed both that and Python.
Ideas?
Thanks in advance.
I had the same problem, in my case I solved it by installing Pythom 32bit instead of the 64bit version.

User avatar
Interitum
Newbie
Posts: 17
Joined: Sun Mar 17, 2013 10:32 pm
Projects: Amor et Vitia
Organization: Interitum Studios
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#123 Post by Interitum »

Yup, 100% positive. I've developed in Java before so I had the JDK even before this.
Unfortunately, I'm running a 32-bit machine, so I can't test out 64-bit installs.
Guess I'm just in bad luck. I'll try running this on my other machines later.
Thanks anyways!
"A wise man once told me, 'Procrastination is like...'"

"I know I am a scout,
And I should have found a way out,
So everyone can find a way out."

I will eat ALL your unhappiness!

Code Monkey
Regular
Posts: 88
Joined: Tue Apr 03, 2012 9:17 am
Projects: Dandelion
Organization: Cheritz
Location: Seoul, South Korea
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#124 Post by Code Monkey »

I am getting the same issue where I can't get past step 2. I've uninstalled and re-installed both the JDK and Python for both 32 bit and 64 bit. I've tried all possible combinations for a few hours and to no avail. Has anyone come across any solutions around this? I'm using Windows 7 64 bit

Hseo
Regular
Posts: 38
Joined: Thu Sep 24, 2009 10:42 am
Completed: High School Life:HSL
Deviantart: greeeed
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#125 Post by Hseo »

Ok for javac part (you didn't download JDK )
You just need to let you PC know where is java file...
=
Justin Buser wrote:To permanently set your JAVA_HOME Environment Variable under Windows do the following:

Click Start, right click on Computer and select properties (you can also hold down the windows key and press the pause/break key).
Click on Advanced system settings on the left.
Click the Environment Variables button on the bottom.
Click the New... button below the System variables window.

Enter the following:

Variable name: JAVA_HOME
Variable value: C:\jdk1.6.0_23\
(C:\jdk1.6.0_23\ = Java home file)

Click Ok, Ok, Ok, and close the system control panel you opened in step 1
Close and re-open your command prompt.
Source:
http://stackoverflow.com/questions/4613 ... ndroid-sdk

//

For Access denied >>> just open android.py with Editra than remove all # line ( three line )

(I might edit it later if I have more problem.)

edit:
- Error 183: [Error 183] Cannot create a file when that file already exists: 'a ssets/common'

Answer = Remove common folder from Mygame(your_game_name) folder

Sourse:
http://direct-lemmasoft.renai.us/forums ... =8&t=18346
Last edited by Hseo on Tue Mar 26, 2013 12:25 pm, edited 1 time in total.

Code Monkey
Regular
Posts: 88
Joined: Tue Apr 03, 2012 9:17 am
Projects: Dandelion
Organization: Cheritz
Location: Seoul, South Korea
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#126 Post by Code Monkey »

Interitum I got it to work with a 64-bit machine by using the 64-bit JDK in the JAVA_HOME path.

JAVA_HOME : C:\Program Files\Java\jdk1.7.0_17

It has to be set, even if the JDK is installed and Java is properly set in the Path Environment Variable and it is found through the cmd. If your JAVA_HOME isn't set, the installer fails at step 2.

kirbysuperstar
Newbie
Posts: 10
Joined: Fri Jan 18, 2013 9:11 pm
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#127 Post by kirbysuperstar »

I updated to the latest version of RAPT (April 1?) and while I can compile/build with no issue, I get this exception when I try to run it. The line the error is referring to seems to be the build.directory_name variable. A Windows build works no issue.

Logcat:

Code: Select all

I/python  (31668): Private directory is /data/data/com.gchoake.pc98/files
I/python  (31668): Argument is /data/data/com.gchoake.pc98/files
I/python  (31668): Handing off to main.
I/python  (31668): /data/data/com.gchoake.pc98/files/renpy/bootstrap.py:268: RuntimeWarning: import cdrom: No module named cdrom
I/python  (31668): (ImportError: No module named cdrom)
I/python  (31668): Imported android.sound.
I/python  (31668): Screen diagonal is 4.44172334235 inches.
I/python  (31668): Full traceback:
I/python  (31668):   File "/home/tom/ab/android-rebuild/private/renpy/execution.py", line 265, in run
I/python  (31668):   File "/home/tom/ab/android-rebuild/private/renpy/ast.py", line 632, in execute
I/python  (31668):   File "/home/tom/ab/android-rebuild/private/renpy/python.py", line 972, in py_exec_bytecode
I/python  (31668):   File "game\options.rpy", line 286, in <module>
I/python  (31668): NameError: name 'build' is not defined
I/python  (31668): While executing init code:
I/python  (31668):   File "game\options.rpy", line 281, in script
I/python  (31668):   File "game\options.rpy", line 286, in python
I/python  (31668): NameError: name 'build' is not defined
I/python  (31668): Logging to /data/data/com.gchoake.pc98/files/log.txt
I/python  (31668): Traceback (most recent call last):
I/python  (31668):   File "start.pyx", line 55, in start (jni/../jni/application/src//start.c:1352)
I/python  (31668):   File "/data/data/com.gchoake.pc98/files/main.py", line 141, in main
I/python  (31668):     renpy.bootstrap.bootstrap(renpy_base)
I/python  (31668):   File "/home/tom/ab/android-rebuild/private/renpy/bootstrap.py", line 323, in bootstrap
I/python  (31668): SystemExit: 0
Device is a Nexus 4 running 4.2.2.
Attachments
Screenshot_2013-04-04-16-49-34.png

Code Monkey
Regular
Posts: 88
Joined: Tue Apr 03, 2012 9:17 am
Projects: Dandelion
Organization: Cheritz
Location: Seoul, South Korea
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#128 Post by Code Monkey »

Has anyone had issues trying to load files on RAPT using open or codecs? Whenever I try to load a file I get "Exception: Couldn't find file 'content/activity/tv/tv/_1_1.xml'." The game works fine on desktop builds and the file exists and I'm using renpy.loader.transfn to load the files, but when I build the game with RAPT, it's as if the sub directories don't get included in the build within the game folder. Any pointers or help as to what I'm doing wrong would be appreciated. Thanks!

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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

#129 Post by PyTom »

How are you opening the files?

On android, the files are stored inside the APK, where possible. To get at them, you want to use renpy.file, which returns a file-like object. transfn won't work - it's not even documented - since the files don't exist on disk.
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

Code Monkey
Regular
Posts: 88
Joined: Tue Apr 03, 2012 9:17 am
Projects: Dandelion
Organization: Cheritz
Location: Seoul, South Korea
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#130 Post by Code Monkey »

Oh thank you for clarifying that. renpy.file works. I was opening the files with codecs.open and renpy.loader.transfn. That was the last step needed in getting Dandelion ported to Android. The game works! Thanks PyTom you're a genius!!! ^_^

User avatar
LolicOnion
Regular
Posts: 42
Joined: Sat Oct 06, 2012 10:36 pm
Contact:

Re: RAPT - Ren'Py Android Packaging Tool

#131 Post by LolicOnion »

I released my VN (https://play.google.com/store/apps/deta ... roid&hl=en) to the Google Play Store on March 23, and I wanted to say how much I appreciate Ren'Py and Rapt for making everything possible!

If you're looking to improve Rapt, The Google developer console has supplied crash info and such. (ex: http://puu.sh/2GG90.png ) Each one goes into more detail if I click on them. I'll even share my game's code with you if you need it. I don't know if any of this can help you or not, but I thought I'd throw it up here anyway just in case anyone was interested.

Thanks for everything!

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

Re: RAPT - Ren'Py Android Packaging Tool

#132 Post by AnonymusSensei »

^
wow cool :D


hy all!
i'm planning to develop VN to android too :D
i'm android developer, indie, so i already used to use eclipse as java build to package to android.
but the file and folder that RAPT generated still makes me confuse...

in order to progress, i only need 2 file
AndroidManifest.xml (easy to found, but well.. it's still a template. is there a 'specific-per-game-file'?)
but the second is so hard, where is the Main File that use .java ??
the list there is :
SDLSurfaceView.java
ResourceManager.java
RenPySound.java
PythonActivity.java
Hardware.java
AssetExtract.java
In Src isn't? but it's all a 'template' for general, right?

is there a way that i can edit the Main File.java for my own specific game?

sory if my question makes confusion, i hope anyone have answer :)

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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

#133 Post by PyTom »

LolicOnion: Cool. I'll take a look at the errors in a bit.

AnonymusSensei: Ren'Py uses the Android NDK, as it's written mostly in C and Python. There isn't really a single main file, although execution mostly starts in PythonActivity.
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

#134 Post by AnonymusSensei »

PyTom wrote:LolicOnion: Cool. I'll take a look at the errors in a bit.

AnonymusSensei: Ren'Py uses the Android NDK, as it's written mostly in C and Python. There isn't really a single main file, although execution mostly starts in PythonActivity.
wow really fast response :D

hmmm yeah looks like that's the one :D

Code: Select all

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
this line usually for main file, thanks :3/

but errr...
how do i change package name to match my game package?

Code: Select all

package org.renpy.android;
as far as i know, my game data is stored in android.jonson or something, right??

so if i add code to pythonActivity (the 'template one' in the src folder), is the final signed .apk will be using my package data from android.jonson WITH additional code that i add in the pythonActivity??

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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

#135 Post by PyTom »

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

Post Reply

Who is online

Users browsing this forum: No registered users