<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Android Release Build</title>
		<link>http://www.allegro.cc/forums/view/613497</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 22 Nov 2013 04:15:22 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I am getting ready to release the Android version of my game and I noticed the game freezes on startup when I use the release build of Allegro. Is it possible to use the release build or should I just stick with the debug build?</p><p>I was able to make a release build of my game using the debug libraries, but I would like to have everything optimized for the release. Has anyone successfully used the release build? I feel like there just might be a bug in my code that doesn&#39;t manifest itself when using the debug version.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Fri, 15 Nov 2013 04:14:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Keep in mind that usually the debug version initializes variables to 0. You might have an uninitialized variable or perhaps uninitialized pointer.</p><p>Is there a way you could see the area it crashes? Do you have a way to produce a Release With Debug Info build?</p><p>If not, perhaps print a log in major areas and see around where it stops logging and check that area.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sat, 16 Nov 2013 23:33:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was going to do the usual debug logging, it&#39;s just much more cumbersome on Android.</p><p>The readme says to use the debug version. I was mainly just wondering if anyone uses the release build and can verify that it works. My game works fine in Windows, OS X, and Linux in release mode.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Sun, 17 Nov 2013 08:49:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/613497/992608#target">Todd Cope</a> said:</div><div class="quote"><p>I was going to do the usual debug logging, it&#39;s just much more cumbersome on Android.</p></div></div><p>It&#39;s &quot;unsupported&quot; but I tend to use allegro&#39;s ALLEGRO_DEBUG macro for loging on android. its really an internal, but it works fine if you want to log to the adb console.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 17 Nov 2013 08:51:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah, that&#39;s what I do already. Can I use that macro in release mode? I was under the impression it gets defined away in release mode. I don&#39;t remember seeing any of the debug messages from the native code when I tested the release build.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Sun, 17 Nov 2013 10:52:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hm, yeah, it&#39;s compiled out in release mode. you could make your own macro that calls __android_log_write.</p><p>eg: <span class="source-code">__android_log_write<span class="k2">(</span>ANDROID_LOG_ERROR, <span class="s">"Tag"</span>, <span class="s">"Error here"</span><span class="k2">)</span><span class="k2">;</span></span></p><p>May need to link to the log library.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 17 Nov 2013 10:56:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for the tip. I&#39;ll try that and see if I can track down where it is freezing.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Sun, 17 Nov 2013 11:11:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Enable the WANT RELEASE LOGGING option in cmake and the logs are generated also in release builds.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sun, 17 Nov 2013 18:40:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks! I logged my program&#39;s initialization phase and it freezes when trying to load TTF fonts. I&#39;ll look into it further when I have more time and post the results here.</p><p>Append: It seems I am running into the error described in <a href="https://www.allegro.cc/forums/thread/613011">this thread</a>. I&#39;m going to try some workarounds...</p><p>Append 2: I was able to get TTF files to load by telling ant not to compress TTF files. Here&#39;s the excerpt from my new <tt>build.xml</tt>:</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>    <span class="k3">&lt;</span>target name<span class="k3">=</span><span class="s">"-package-resources"</span> depends<span class="k3">=</span><span class="s">"-crunch"</span><span class="k3">&gt;</span>
<span class="number">  2</span>        <span class="k3">&lt;</span><span class="k3">!</span><span class="k3">-</span><span class="k3">-</span> only package resources <span class="k1">if</span> <span class="k3">*</span><span class="k1">not</span><span class="k3">*</span> a library project <span class="k3">-</span><span class="k3">-</span><span class="k3">&gt;</span>
<span class="number">  3</span>        <span class="k3">&lt;</span>do-only-if-not-library elseText<span class="k3">=</span><span class="s">"Library project: do not package resources..."</span> <span class="k3">&gt;</span>
<span class="number">  4</span>            <span class="k3">&lt;</span>aapt executable<span class="k3">=</span><span class="s">"${aapt}"</span>
<span class="number">  5</span>                    command<span class="k3">=</span><span class="s">"package"</span>
<span class="number">  6</span>                    versioncode<span class="k3">=</span><span class="s">"${version.code}"</span>
<span class="number">  7</span>                    versionname<span class="k3">=</span><span class="s">"${version.name}"</span>
<span class="number">  8</span>                    debug<span class="k3">=</span><span class="s">"${build.is.packaging.debug}"</span>
<span class="number">  9</span>                    manifest<span class="k3">=</span><span class="s">"${out.manifest.abs.file}"</span>
<span class="number"> 10</span>                    assets<span class="k3">=</span><span class="s">"${asset.absolute.dir}"</span>
<span class="number"> 11</span>                    androidjar<span class="k3">=</span><span class="s">"${project.target.android.jar}"</span>
<span class="number"> 12</span>                    apkfolder<span class="k3">=</span><span class="s">"${out.absolute.dir}"</span>
<span class="number"> 13</span>                    nocrunch<span class="k3">=</span><span class="s">"${build.packaging.nocrunch}"</span>
<span class="number"> 14</span>                    resourcefilename<span class="k3">=</span><span class="s">"${resource.package.file.name}"</span>
<span class="number"> 15</span>                    resourcefilter<span class="k3">=</span><span class="s">"${aapt.resource.filter}"</span>
<span class="number"> 16</span>                    libraryResFolderPathRefid<span class="k3">=</span><span class="s">"project.library.res.folder.path"</span>
<span class="number"> 17</span>                    libraryPackagesRefid<span class="k3">=</span><span class="s">"project.library.packages"</span>
<span class="number"> 18</span>                    libraryRFileRefid<span class="k3">=</span><span class="s">"project.library.bin.r.file.path"</span>
<span class="number"> 19</span>                    previousBuildType<span class="k3">=</span><span class="s">"${build.last.target}"</span>
<span class="number"> 20</span>                    buildType<span class="k3">=</span><span class="s">"${build.target}"</span>
<span class="number"> 21</span>                    ignoreAssets<span class="k3">=</span><span class="s">"${aapt.ignore.assets}"</span><span class="k3">&gt;</span>
<span class="number"> 22</span>                <span class="k3">&lt;</span>res path<span class="k3">=</span><span class="s">"${out.res.absolute.dir}"</span> <span class="k3">/</span><span class="k3">&gt;</span>
<span class="number"> 23</span>                <span class="k3">&lt;</span>res path<span class="k3">=</span><span class="s">"${resource.absolute.dir}"</span> <span class="k3">/</span><span class="k3">&gt;</span>
<div class="highlight"><span class="number"> 24</span>                <span class="k3">&lt;</span>nocompress extension<span class="k3">=</span><span class="s">"ttf"</span> <span class="k3">/</span><span class="k3">&gt;</span></div><span class="number"> 25</span>                <span class="k3">&lt;</span><span class="k3">!</span><span class="k3">-</span><span class="k3">-</span> <span class="k3">&lt;</span>nocompress <span class="k3">/</span><span class="k3">&gt;</span> forces no compression on any files in assets <span class="k1">or</span> res<span class="k3">/</span>raw <span class="k3">-</span><span class="k3">-</span><span class="k3">&gt;</span>
<span class="number"> 26</span>                <span class="k3">&lt;</span><span class="k3">!</span><span class="k3">-</span><span class="k3">-</span> <span class="k3">&lt;</span>nocompress extension<span class="k3">=</span><span class="s">"xml"</span> <span class="k3">/</span><span class="k3">&gt;</span> forces no compression on specific file extensions in assets <span class="k1">and</span> res<span class="k3">/</span>raw <span class="k3">-</span><span class="k3">-</span><span class="k3">&gt;</span>
<span class="number"> 27</span>            <span class="k3">&lt;</span><span class="k3">/</span>aapt&gt;
<span class="number"> 28</span>        <span class="k3">&lt;</span><span class="k3">/</span>do-only-if-not-library&gt;
<span class="number"> 29</span>    <span class="k3">&lt;</span><span class="k3">/</span>target&gt;
</div></div><p>
Append 3: It appears <span class="source-code"><a href="http://www.allegro.cc/manual/al_fsize"><span class="a">al_fsize</span></a><span class="k2">(</span><span class="k2">)</span></span> doesn&#39;t work on compressed files within the APK. I also found out that the release build is failing to use the PhysFS add-on for resource loading. In my framework, I have it attempt to locate the app&#39;s resources via PhysFS. If that fails, it sets the APK interface.</p><p>So ultimately, the issues I am having are due to the PhysFS code path failing and falling back to the APK interface.</p><p>Append 4: I fixed the problem by passing the path returned by <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span>ALLEGRO_EXENAME_PATH<span class="k2">)</span></span> to <span class="source-code">PHYSFS_init<span class="k2">(</span><span class="k2">)</span></span> instead of <span class="source-code">argv<span class="k2">[</span><span class="n">0</span><span class="k2">]</span></span> from <span class="source-code">main<span class="k2">(</span><span class="k2">)</span></span>. I don&#39;t see why it would be different between debug and release builds but apparently it is.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Fri, 22 Nov 2013 02:18:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/613497/992681#target">Todd Cope</a> said:</div><div class="quote"><p> I don&#39;t see why it would be different between debug and release builds but apparently it is. </p></div></div><p>Heh, I remember getting upset about Turbo Debugger tidying up the command line args in the DOS Program Segment Prefix when I was trying to get a program to break while testing.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Fri, 22 Nov 2013 04:15:22 +0000</pubDate>
	</item>
</rss>
