JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   On Github   Forums 
December 06, 2021, 04:19:17 PM *
Welcome,
Please login or register.

Login with username, password and session length
Advanced search  
News: New users, please read this message. Thank you!
  Home Help Search Login Register  
Pages: [1]   Go Down

Author Topic: Troubleshooting: android-package and solve errors in eclipse and during building  (Read 1547 times)

flo

  • Guest

Dear developers,

I have tried working with your code for some days now.
I did the following process and during the download, import and my first investigations came up a lot of questions.

    - The packages Subclipse and CheckStyle are both used

    - The first approach was to download the full source code of jppf 5.1.4 from
    https://sourceforge.net/projects/jppf-project/files/jppf-project/jppf%205.1.4/JPPF-5.1.4-full-src.zip/download

    The Import in eclipse was successful, but there appeared more than 1000 errormarks.
    I recognised that some of them come from the missing package android, so I downloaded it and made a manual add to the libraries.
    Some errors are removed and only 613 left to solve. Some of them are still related to the use of the android package, especially the use of "R".
    Could you please give me a desription how to install and do the import to use android or tell me how to exclude all files which use android-dependencies?

    After this try I decided to check out your SVN-Files of the 5.2 beta version. In a comparison between the two directories, I found some missing files in the first
    approach. The errors after the import are nearly the same. This is the reason why I decided to work with the released one.

    - The next step was to build the files from the source code with ant by using the cmd-command "ant deploy" in the directory ...\JPPF\bin\ .
    Threre showed up a couple of erors, each after solving another:

        - ...\JPPF\bin\CheckStyle_JPPF_config.xml is missing.
        So I commented all lines where this file is used/called.

        - Files in ...\samples-pack\shared\lib do not exist.
        To solve this are the lines 70-82 in JPPF\bin\build-samples.xml switched to a comment.

        - The command in line 52 of JPPF\bin\build-android.xml (exec) returned 1, so the execution aborted.
        My solution to this problem was to exclude the build of the android-application files.

        - There showed up the problems that the directory ...\JPPF\docs\manual does not exist and the
        file samples-pack\index.php cannot be found.

        - JPPF\classes does not exist
        To solve this and the last one the lines 80, 90 and from 176 to 182 were commented in the file
        JPPF/bin/build-docs.xml

    After solving these issues the build was created successfully, but I can not imagine, that this is the right way. So I ask you for some tipps:

        - Do you have any Idea why I have so many errors ("... cannot be resolved to a variable" and "... cannot be resolved to a type") in eclipse?
      
        - Could you give me hint how to use the android package that it works?
      
        - Is there a package with full code and a complete structure to make a correct build process?

Thank you very much for your answer!

Best Regards
Flo
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2272
    • JPPF Web site

Hello Flo,

You are right, there are many issues with the source distribution and I apologize for the inconvenience.
To track and fix this problem, I registered a bug report: JPPF-461 The source distribution does not build properly.

In the meantime, the best way is to checkout the code from the SVN repository and build it from there. Here are step by step instructions which I hope will help:

Prerequisites:

- to be able to build the Android node project properly, you need to define the ANDROID_HOME environment variable and make it point to the Android SDK installation root. For instance:
Code: [Select]
export ANDROID_HOME=/home/me/android-sdk- you must also make sure that you have installed (with the Android sdk manager) the "Android 4.4.2 (API 19) SDK Platform" and the "Android SDK Build-tools" version 23.0.1
- make sure that you have the Subclipse (>= 1.8.0) and Checkstyle plugins installed in Eclipse. You can get them from the Eclipse market place
- you also need to define a classpath variable "JDK_HOME" that points to the root installation folder of your JDK (make sure it's a JDK and not a JRE): "Window > Preferences > Java > Build Path > Classpath Variables" then click on "New ...". This is needed because JPPF uses a custom doclet for the javadoc, whose source is in JPPF/src, and the JDK's tools.jar is needed as a dependency

Importing the code:

- once the plugins are installed, open the "SVN Repository Exploring" perspective and create a new SVN repository location (right-click in the "SVN Repositories" view and select "New > Repository Location")
- enter "http://svn.code.sf.net/p/jppf-project/code/" as the url: this is the root of the JPPF SVN repo.
- now depending on which version you want to build:
  * if you want the latest and greatest, expand the "trunk" subfolder
  * if you want the code from another branch, expand "branches" and select the one you want. For example branches/b_5_1 contains the latest code for the 5.1.x branch
  * if you want the code from a specific version, expand "tags" and select the one you want. For example tags/v_5_1_4 contains the code for JPPF 5.1.4
- select all the modules under the branch or version you chose, then right-click and select "Checkout"
- in the next dialog, just click "finish" and the projects are checked out into your workspace
- everything should be imported and there should be no build error when you get back to the Java perspective

Building the Android node:

- the Android node is not an Eclipse project, rather it is an Android Studio project. To edit/modify the code, the best is to open it with Android Studio, however it is not necessary if you just want to build it
- JPPF uses Ant as its build system, and it uses a specific Ant target to invoke the build of the Android node
- in Eclipse, open the Ant view: "Window > Show View > Ant"
- add this build file: JPPF/bin/build.xml
- in this build file, run the target "build.android" by double-clicking it (you can also do it in the command line by running "ant build.android" in JPPF/bin)

Building everything:

Simply run one of the "deploy[.xxx]" targets
All the build artifacts (zip, jar apk) are created under JPPF/build.

I hope this helps,
-Laurent
« Last Edit: July 05, 2016, 09:55:44 AM by lolo »
Logged

flo

  • Guest

Hello Laurant,

thank you very much for your fast response and the wide explanation.

For my intents we only need the runtime-package (driver, gui, node). The building process
of these components works without any errors.

When I try to run the build.android command in cmd or eclipse, the following error still shows up while building the android.apk:

Quote
build.android.apk:
     [exec] copying jar files to demo project
     [exec] copying events-release.aar to demo project
     [exec] BUILD FAILED
     [exec] Total time: 5.669 secs
     [exec] FAILURE: Build failed with an exception.
     [exec] * What went wrong:
     [exec] A problem occurred configuring project ':app'.
     [exec] > A problem occurred configuring project ':events'.
     [exec]    > failed to find Build Tools revision 23.0.0
     [exec] * Try:
     [exec] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
...\JPPF\bin\build-android.xml:52: exec returned: 1

So I expect that it is still depending on my android directory.
I have checked the installation of ANDROID_HOME/platforms/android-19 and ANDROID_HOME/build-tools/23.0.1.

Could the statement "failed to find Build Tools revision 23.0.0" be the reason for the fail?
Or do you have other ideas, which setting could cause this error?

Kind regards
Flo
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2272
    • JPPF Web site

Hi Flo,

Quote
Could the statement "failed to find Build Tools revision 23.0.0" be the reason for the fail?

Yes, this is the cause of the problem. JPPF 5.1.x still uses the version 23.0.0 of the build tools. A quick fix is to install them via the Android SDK manager. Since it is marked as obsolete, you will have to click in the "Packages" menu and select "Show obsolete packages" to make it show up in the list. I will change the build tools version as part of the fix for JPPF-461

Another, less convenient way is to manually change the build tools version to 23.0.1 in the build.gradle of each module (node-android/app, node-android/demo, node-android/events)

Sincerely,
-Laurent
Logged

flo

  • Guest

Now it works.
I found the point in node-android/app but didn't look in the other directories.

Thank you very much for your help and your advices!!

Best regards
Flo
Logged
Pages: [1]   Go Up
 
JPPF Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Get JPPF at SourceForge.net. Fast, secure and Free Open Source software downloads