Compiling the android apk

Need help? Post your questions here.

Moderator: moderators

Compiling the android apk

Postby darwusch » Sun Nov 13, 2011 10:22 am

Hi,

After I compiled the subsonic-main, I would like to compile the android apk, subsonic-android.
The main I compiled with:
Code: Select all
mvn clean install

from the root directory of the source folders.
But this is not possible for the android app because there is no pom.xml in that directory.
There is a build.xml file, I guess this should be used, but can anybodey tell me how? With which command?
Last edited by darwusch on Thu Nov 24, 2011 6:23 pm, edited 1 time in total.
darwusch
 
Posts: 6
Joined: Sun Nov 13, 2011 10:16 am

Re: Compiling the android apk

Postby darwusch » Wed Nov 16, 2011 4:52 pm

So many smart people here, I'm sure some of you know the commands to compile the apk.
Anybody?
darwusch
 
Posts: 6
Joined: Sun Nov 13, 2011 10:16 am

Re: Compiling the android apk

Postby sindre_mehus » Tue Nov 22, 2011 5:59 pm

The android app is compiled with ant. Install ant + Android SDK and do "ant help" for a list of goals.

Cheers,
Sindre
Subsonic developer
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Re: Compiling the android apk

Postby darwusch » Thu Nov 24, 2011 5:43 pm

Thanks, I get some errors:

Code: Select all
C:\Subsonic>cd subsonic-android

C:\Subsonic\subsonic-android>ant
Buildfile: C:\Subsonic\subsonic-android\build.xml
Duplicated project name in import. Project subsonic defined first in C:\Subsonic\subsonic-android\build.xml and again in C:\Progra~2\Android\android-sdk\tools\ant\build.xml

BUILD FAILED
Target "help" does not exist in the project "subsonic".

Total time: 0 seconds


The duplicate name does not seem to be the problem, but the target mentioned in the xml file doesn't seem to exist.
Is this missing?
darwusch
 
Posts: 6
Joined: Sun Nov 13, 2011 10:16 am

Re: Compiling the android apk

Postby darwusch » Wed Nov 30, 2011 8:43 am

Some extra information.
In the build.xml file (in the root of the subsonic-android directory) the following line seems to cause this error:

Code: Select all
<project name="subsonic" default="help">


So I guess it looks for a target named "help", which does not exist. Is this missing or should I change this target?
darwusch
 
Posts: 6
Joined: Sun Nov 13, 2011 10:16 am

Re: Compiling the android apk

Postby darwusch » Wed Nov 30, 2011 5:21 pm

Ok, after a lot of trying I managed to get a bit further. Now it compiles to an apk file.
Only the last part where the apk should get signed, it fails.

Code: Select all
C:\Download\Subsonic\subsonic-android>ant release
Buildfile: C:\Download\Subsonic\subsonic-android\build.xml

-set-mode-check:

-set-release-mode:

-release-obfuscation-check:

-setup:
     [echo] Gathering info for subsonic...
    [setup] Android SDK Tools Revision 15
    [setup] Project Target: Android 2.3.3
    [setup] API level: 10
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup]
    [setup] ------------------
    [setup]
    [setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (3) is lower than the project ta
rget API level (10)

-build-setup:
     [echo] Creating output directories if needed...

-pre-build:

-code-gen:
     [echo] ----------
     [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] Found Deleted Target File
     [aapt] Generating resource IDs...

-pre-compile:

-compile:
    [javac] C:\Progra~2\Android\android-sdk\tools\ant\build.xml:600: warning: 'includeantruntime' wa
s not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to C:\Download\Subsonic\subsonic-android\bin\classes

-post-compile:

-obfuscate:

-dex:
      [dex] Found Deleted Target File
      [dex] Converting compiled files and external libraries into C:\Download\Subsonic\subsonic-andr
oid\bin\classes.dex...

-crunch:
   [crunch] Crunching PNG Files in source dir: C:\Download\Subsonic\subsonic-android\res
   [crunch] To destination dir: C:\Download\Subsonic\subsonic-android\bin\res
   [crunch] Crunched 0 PNG files to update cache

-package-resources:
     [aapt] Found Deleted Target File
     [aapt] Creating full resource package...

-package:
[apkbuilder] Found Deleted Target File
[apkbuilder] Creating subsonic-release-unsigned.apk for release...

-release-prompt-for-password:
    [input] Please enter keystore password (store:subsonic.keystore):
subsonic
    [input] Please enter password for alias 'subsonic':
subsonic


-release-nosign:

release:
     [echo] Signing final apk...
  [signjar] Signing JAR: C:\Download\Subsonic\subsonic-android\bin\subsonic-release-unsigned.apk to
C:\Download\Subsonic\subsonic-android\bin\subsonic-release-unaligned.apk as subsonic
  [signjar] jarsigner error: java.lang.RuntimeException: keystore load: Keystore was tampered with,
or password was incorrect

BUILD FAILED
C:\Progra~2\Android\android-sdk\tools\ant\build.xml:952: The following error occurred while executin
g this line:
C:\Progra~2\Android\android-sdk\tools\ant\build.xml:965: jarsigner returned: 1

Total time: 29 seconds


How can I fix this?
darwusch
 
Posts: 6
Joined: Sun Nov 13, 2011 10:16 am

Re: Compiling the android apk

Postby darwusch » Fri Dec 02, 2011 5:56 pm

Ok, I found a work around.
With apk manager I could sign the apk.
Now I run my self-compiled apk on my android phone, very nice.
Thanks for the help.
darwusch
 
Posts: 6
Joined: Sun Nov 13, 2011 10:16 am

Re: Compiling the android apk

Postby DBendit » Mon Feb 13, 2012 5:34 am

Does anyone know the proper way to work around this? I'm attempting to compile the android APK on linux. I can build it fine with `ant debug` and from Eclipse, but when trying to do `ant release`, no passwords that I provide for the keystores work. Does anyone know the appropriate keystore passwords to allow proper release building of this?

For reference, the output of `ant release`:
Code: Select all
Buildfile: /home/dbendit/Development/supersonic/subsonic-android/build.xml

-set-mode-check:

-set-release-mode:

-release-obfuscation-check:

-setup:
     [echo] Gathering info for subsonic...
    [setup] Android SDK Tools Revision 16
    [setup] Project Target: Android 2.3.3
    [setup] API level: 10
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup]
    [setup] ------------------
    [setup]
    [setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (3) is lower than the project target API level (10)

-build-setup:
     [echo] Creating output directories if needed...

-pre-build:

-code-gen:
     [echo] ----------
     [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] No changed resources. R.java and Manifest.java untouched.

-pre-compile:

-compile:

-post-compile:

-obfuscate:

-dex:
      [dex] No new compiled code. No need to convert bytecode to dalvik format.

-crunch:
   [crunch] Crunching PNG Files in source dir: /home/dbendit/Development/supersonic/subsonic-android/res
   [crunch] To destination dir: /home/dbendit/Development/supersonic/subsonic-android/bin/res
   [crunch] Crunched 0 PNG files to update cache

-package-resources:
     [aapt] Current build type is different than previous build: forced aapt run.
     [aapt] Creating full resource package...

-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating subsonic-release-unsigned.apk for release...

-release-prompt-for-password:
    [input] Please enter keystore password (store:subsonic.keystore):
subsonic
    [input] Please enter password for alias 'subsonic':
subsonic

-release-nosign:

release:
     [echo] Signing final apk...
  [signjar] Signing JAR: /home/dbendit/Development/supersonic/subsonic-android/bin/subsonic-release-unsigned.apk to /home/dbendit/Development/supersonic/subsonic-android/bin/subsonic-release-unaligned.apk as subsonic
  [signjar] jarsigner error: java.lang.RuntimeException: keystore load: Keystore was tampered with, or password was incorrect

BUILD FAILED
/home/dbendit/Development/android-sdk-linux/tools/ant/build.xml:981: The following error occurred while executing this line:
/home/dbendit/Development/android-sdk-linux/tools/ant/build.xml:994: jarsigner returned: 1
DBendit
 
Posts: 1
Joined: Sun Apr 10, 2011 6:41 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 37 guests