You can make the fix in the build.xml by overriding the macro there.
Here is where I made the fix:

    <macrodef name="dex-helper">
        <element name="external-libs" optional="yes" />
        <element name="extra-parameters" optional="yes" />
        <sequential>
            <!-- sets the primary input for dex. If a pre-dex task
sets it to
                 something else this has no effect -->
            <property name="out.dex.input.absolute.dir" value="$
{out.classes.absolute.dir}" />

            <!-- set the secondary dx input: the project (and library)
jar files
                 If a pre-dex task sets it to something else this has
no effect -->
            <if>
                <condition>
                    <isreference refid="out.dex.jar.input.ref" />
                </condition>
                <else>
                    <path id="out.dex.jar.input.ref">
                        <path refid="jar.libs.ref" />
                    </path>
                </else>
            </if>

            <echo>Converting compiled files and external libraries
into ${intermediate.dex.file}...</echo>
            <apply executable="${dx}" failonerror="true"
parallel="true">
                <arg value="--dex" />
                <arg value="--output=${intermediate.dex.file}" />
                <extra-parameters />
                <arg line="${verbose.option}" />
                <arg path="${out.dex.input.absolute.dir}" />
                <path refid="out.dex.jar.input.ref" />
                <!-- path refid="jar.libs.ref" / -->
                <external-libs />
            </apply>
        </sequential>
    </macrodef>

Just put this into your build.xml (remove the comment). Your are right
about the obfuscation, and I guess this is the reason they forgot it
as if you add it here all the time, the obfuscated builds will fail as
they already contain the libs.

If you need both you might have to capsule the <apply> block with an
if.

Be warned, we did that a lot in the past (override tasks and macros in
our local build files) but Google changes that stuff a lot (mostly
without a good reason in my eyes) which means you might have to update
it with every new sdk revision coming out.

However I really want a in time fix by Google on this.
--
Andreas

On Dec 10, 10:41 am, Matt Quigley <matthew.quig...@gmail.com> wrote:
> AHH!  This latest update to Android SDK v8 has made my life hell.
>
> 1. The change that makes the compiler fail when strings have multiple
> formatter specifications (%d, %s, etc.) without position arguments
> (%1d, %2s, etc.) is new.  This means that ALL PREVIOUS TAGS/BRANCHES/
> ETC. IN THE REPOSITORY HISTORY WILL NO LONGER BUILD.
>
> > The app will build but then crash during runtime because of the
> > missing libs.
>
> 2. Confirmed that this is a bug, introduced in Android SDK Tools
> revision 8.  The Ant builds no longer work with external libraries.
> Interestingly enough, if you build your project in release mode with
> debuggable="false" in your manifest, the ProGuard obfuscation step
> will include your external libraries and you won't see this problem.
> However, when ProGuard isn't used, you'll see this problem. Andreas,
> I'm not sure where you added that line <path refid="jar.libs.ref" />.
> I need to make this fix in the build.xml file, not in the Android SDK
> Tools directory, because this change needs to work on all of my team's
> machines and the build machine.  I'll try to find a solution and post
> it here.
>
> --
> Matt

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to