Building JasperMobile with Eclipse/Maven for Android

I currently have to build a mobile client for the Jaspersoft Report Server on android. In order to do so I got the source code of the existing open source JasperMobile app, thinking I could use this as a basis/template and extend it with the specific features our company needs. After sorting out a ton of build problems I am stuck with one last one:

When building I get the following output from maven:

[INFO] Scanning for projects...
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building js-android-jaspermobile 1.5
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ js-android-jaspermobile ---
    [INFO] Deleting C:\Development\JasperMobile\target
    [INFO]
    [INFO] --- android-maven-plugin:3.3.0:generate-sources
    (default-generate-sources) @ js-android-jaspermobile ---
    [DEBUG] Expanding: c:\DEVELOPMENT\maven\repo\com\actionbarsherlock\actionbarsherlock\4.3.1
    \actionbarsherlock-4.3.1.apklib into C:\Development\JasperMobile\target\unpack\apklibs
    \com.actionbarsherlock_actionbarsherlock_apklib_4.3.1
    [DEBUG] expand complete
    [INFO] ANDROID-904-002: Found aidl files: Count = 0
    [INFO] ANDROID-904-002: Found aidl files: Count = 0
    [INFO] ANDROID-904-002: Found aidl files: Count = 0
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.767s
    [INFO] Finished at: Tue Jul 09 14:49:37 CAT 2013
    [INFO] Final Memory: 6M/11M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-
    plugin:3.3.0:generate-sources (default-generate-sources) on project js-android-
    jaspermobile: Execution default-generate-sources of goal
    com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.3.0:generate-sources
    failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as
    configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an
    alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set
    environment variable ANDROID_HOME. -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the
    following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

I have read up about this problem and it appears to be related to the eclipse plug-in used to integrate maven with android development. It looks for aapt.exe and aidl.exe in \platform-tools\ instead of \build-tools\. The current work-around seems to be to make symlinks (using mklink as admin in win7) for the necessary files, but when linking an executable I get a broken file instead of a link, even though according to cmd the operation is successful.

Please I am a mavin and windoze n00b so if there maybe is another workaround? maybe point maven to the correct location? some other tool for symlinking?

Thanks all!

albert.smit's picture
Joined: Jul 1 2013 - 7:47am
Last seen: 9 years 7 months ago

hi Albert,

i am new Jaspersoft andriod development.  i have dowloaded the (jaspersoft-mobile-sdk-android-1.5-src.zip)JasperMobile source code that I downloaded. i am using eclipse added new project and am getting  the error message "The declared package "com.jaspersoft.android.jaspermobile" does not match the expected package "main.java.com.jaspersoft.android.jaspermobile".

please help me how to fix this. or share me step by to step approach how to create report or embedded report on MyFirst APP ?.

Thanks in Advance.

Regds,

Rajesh. S

rajesh.sm - 9 years 8 months ago

1 Answer:

Hi Albert,

 
It's the issue with maven-android-plugin and latest android ADT from Google:
 
It was fixed in v 3.6.0, so you just need to update you android-maven-plugin to this version:
 
    <plugin>
        <groupId>com.jayway.maven.plugins.android.generation2</groupId>
        <artifactId>android-maven-plugin</artifactId>
        <version>3.6.0</version>
        ...
    </plugin>
igadzhega's picture
350
Joined: Jan 16 2011 - 3:44am
Last seen: 9 years 4 weeks ago

And there is a issue with maven 3.1.0 , it seems good to use android-maven-plugin 3.6.* with maven 3.0.5

Nash171 - 9 years 7 months ago
Feedback