strange problem when using android runner

Hi all
I am new to TeamCity and want to use it on our team Android project.
I use android runner plugin. Here is my TC projects settings:

TCsettings.jpg


TCSetting2.jpg

TC can general apk successfully but I found when I use android.MediaPlayer to play mp3 file in assets dir, other things are all ok except music. It WON'T work! While using Eclipse, same project,same code, it can!!
the TC apk and Eclipse apk both include assets dir and mp3 file. There are different size between 2 classes.dex in apks. The TC one has smaller classes.dex in size.

I am wondering is there anything I missed, or I should put arguments to Advanced parameters for android runner.

Here I upload my test project. It can import with Eclipse and build apk with mp3 play ok.

Can anyone help me with this.

Thanks a lot!



Attachment(s):
TeamCityTestBuild.zip
3 comments
Comment actions Permalink

Hi,

What is your setting for "native libraries directories"? You have a "libs\libProgressMonitor.jar" library in your project, so if you want this library to be added to the classes.dex you have to add "libs" directory to that setting. If you did not do that it can be the cause of the smaller size of "classes.dex" for the package built by TeamCity.

0
Comment actions Permalink

Hi Maxim
Thank you for reply.
Actually the ibs\libProgressMonitor.jar is irrelevant in this test project.
You can remove this jar from Eclipse project and the problem is still the same.

I catch the android.MediaPlayer exception and print it on the screen. I get this error message:

exception.jpg

From google I learned that Eclipse will not compress some type of file in assets dir, and mp3 is one of them.
Maybe in Android Runner aapt will compress mp3 file so the program can not open it.

I also try to add -0 "" argument at runner aapt command line, but no luck.

Is there possibility runner aapt compress assets file while Eclipse not.

I want to check whether the mp3 is compress in apk file or not.

Or this exception message is just a misleading?

Thanks a lot!

0
Comment actions Permalink

Using aapt l -a command, I list two apk file.

One apk is made by Android runner:
runner_table.jpg

The other apk is made by Eclipse:
eclipse_table.jpg
As you can see, in Eclipse, there are 5 files which are not compressed. They are in assets and res dir. But by Android runner, they are all compressed. That's why the mp3 file can not be read and system throws exception.
How can I let aapt not compress this 2 dirs' files?

0

Please sign in to leave a comment.