How to compile odk-collect from source

Hi,

Is there some how-to or tutorial for compiling ODK Collect from source?
I've done some search and can't find anything.

I'm completely new to compiling an Android application from source, but
I need to try some patches that are supposed to fix a couple of very
critical bugs in ODK Collect, so I thought first of all I'd start by
downloading the source code of ODK collect and compile it as-is, before
trying to apply any patch at all.

I downloaded and installed Eclipse (Oh I'm on Ubuntu Linux), the Android
SDK, the ADT plugin for Eclipse, all versions of Android Platform and
Google APIs, and the ODK Collect source code. In Eclipse, I imported the
source code by doing File/Import/Existing projects into Workspace and I
browsed to the ODK Collect source code location.

It seems to have imported the project but now I don't know how to build
it. I tried Project/Clean and it gives me this error:

Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project 'ODK Collect'.
Resource '/ODK Collect/gen' does not exist.
Resource '/ODK Collect/gen' does not exist.

I guess I'm missing something very basic, I had never even used Eclipse
before...

Thanks in advance
m.

sometimes eclipse screws up. try manually creating a gen folder in
project. then clean the project and see if that helps.

··· On Sun, Sep 25, 2011 at 18:51, Matteo Sisti Sette wrote: > Hi, > > Is there some how-to or tutorial for compiling ODK Collect from source? I've > done some search and can't find anything. > > I'm completely new to compiling an Android application from source, but I > need to try some patches that are supposed to fix a couple of very critical > bugs in ODK Collect, so I thought first of all I'd start by downloading the > source code of ODK collect and compile it as-is, before trying to apply any > patch at all. > > I downloaded and installed Eclipse (Oh I'm on Ubuntu Linux), the Android > SDK, the ADT plugin for Eclipse, all versions of Android Platform and Google > APIs, and the ODK Collect source code. In Eclipse, I imported the source > code by doing File/Import/Existing projects into Workspace and I browsed to > the ODK Collect source code location. > > It seems to have imported the project but now I don't know how to build it. > I tried Project/Clean and it gives me this error: > > Errors occurred during the build. > Errors running builder 'Android Pre Compiler' on project 'ODK Collect'. > Resource '/ODK Collect/gen' does not exist. > Resource '/ODK Collect/gen' does not exist. > > > I guess I'm missing something very basic, I had never even used Eclipse > before... > > Thanks in advance > m. >

Hi Matteo,

I'm launching a project based on ODK Collect as well and I'm blocked
at the very beginning in the eclipse setup step...
As you seem to have been able to succesfully configure your
environment, would you be so kind as to lighten me about how to setup
eclipse ?

A simple step by step explanation, including how you've managed to
download the sources would fit so very well !

Many tanks in advance if you take some time to guide me !

Sylvain

··· On 25 sep, 17:51, Matteo Sisti Sette wrote: > Hi, > > Is there some how-to or tutorial for compiling ODKCollectfrom source? > I've done some search and can't find anything. > > I'm completely new to compiling an Android application from source, but > I need to try some patches that are supposed to fix a couple of very > critical bugs in ODKCollect, so I thought first of all I'd start by > downloading the source code of ODKcollectand compile it as-is, before > trying to apply any patch at all. > > I downloaded and installedEclipse(Oh I'm on Ubuntu Linux), the Android > SDK, the ADT plugin forEclipse, all versions of Android Platform and > Google APIs, and the ODKCollectsource code. InEclipse, I imported the > source code by doing File/Import/Existing projects into Workspace and I > browsed to the ODKCollectsource code location. > > It seems to have imported the project but now I don't know how to build > it. I tried Project/Clean and it gives me this error: > > Errors occurred during the build. > Errors running builder 'Android Pre Compiler' on project 'ODKCollect'. > Resource '/ODKCollect/gen' does not exist. > Resource '/ODKCollect/gen' does not exist. > > I guess I'm missing something very basic, I had never even usedEclipse > before... > > Thanks in advance > m.

Hello,

I am also trying to compile the ODK Collect from source using Eclipse but with no luck.
Can someone post some detailed instructions on how to accomplish this?

Thanks

Hi,

Never mind, I knew I had to be missing something very basic: I had to
select a target platform in Projects/Properties.

Now I've been able to build, export and run it!

thanks
m.

··· On 09/25/2011 06:41 PM, Yaw Anokwa wrote: > sometimes eclipse screws up. try manually creating a gen folder in > project. then clean the project and see if that helps. > > On Sun, Sep 25, 2011 at 18:51, Matteo Sisti Sette wrote: >> Hi, >> >> Is there some how-to or tutorial for compiling ODK Collect from source? I've >> done some search and can't find anything. >> >> I'm completely new to compiling an Android application from source, but I >> need to try some patches that are supposed to fix a couple of very critical >> bugs in ODK Collect, so I thought first of all I'd start by downloading the >> source code of ODK collect and compile it as-is, before trying to apply any >> patch at all. >> >> I downloaded and installed Eclipse (Oh I'm on Ubuntu Linux), the Android >> SDK, the ADT plugin for Eclipse, all versions of Android Platform and Google >> APIs, and the ODK Collect source code. In Eclipse, I imported the source >> code by doing File/Import/Existing projects into Workspace and I browsed to >> the ODK Collect source code location. >> >> It seems to have imported the project but now I don't know how to build it. >> I tried Project/Clean and it gives me this error: >> >> Errors occurred during the build. >> Errors running builder 'Android Pre Compiler' on project 'ODK Collect'. >> Resource '/ODK Collect/gen' does not exist. >> Resource '/ODK Collect/gen' does not exist. >> >> >> I guess I'm missing something very basic, I had never even used Eclipse >> before... >> >> Thanks in advance >> m. >> >

have you tried http://code.google.com/p/opendatakit/wiki/DevelopmentEnvironment?

··· On Wed, Oct 12, 2011 at 02:36, Administrateur Messagerie UP SELL wrote: > Hi Matteo, > > I'm launching a project based on ODK Collect as well and I'm blocked > at the very beginning in the eclipse setup step... > As you seem to have been able to succesfully configure your > environment, would you be so kind as to lighten me about how to setup > eclipse ? > > A simple step by step explanation, including how you've managed to > download the sources would fit so very well ! > > Many tanks in advance if you take some time to guide me ! > > Sylvain > > On 25 sep, 17:51, Matteo Sisti Sette wrote: >> Hi, >> >> Is there some how-to or tutorial for compiling ODKCollectfrom source? >> I've done some search and can't find anything. >> >> I'm completely new to compiling an Android application from source, but >> I need to try some patches that are supposed to fix a couple of very >> critical bugs in ODKCollect, so I thought first of all I'd start by >> downloading the source code of ODKcollectand compile it as-is, before >> trying to apply any patch at all. >> >> I downloaded and installedEclipse(Oh I'm on Ubuntu Linux), the Android >> SDK, the ADT plugin forEclipse, all versions of Android Platform and >> Google APIs, and the ODKCollectsource code. InEclipse, I imported the >> source code by doing File/Import/Existing projects into Workspace and I >> browsed to the ODKCollectsource code location. >> >> It seems to have imported the project but now I don't know how to build >> it. I tried Project/Clean and it gives me this error: >> >> Errors occurred during the build. >> Errors running builder 'Android Pre Compiler' on project 'ODKCollect'. >> Resource '/ODKCollect/gen' does not exist. >> Resource '/ODKCollect/gen' does not exist. >> >> I guess I'm missing something very basic, I had never even usedEclipse >> before... >> >> Thanks in advance >> m. >

Hello Matteo,

I have been trying to compile odk-collect source but have so far not
managed. I am using eclipse to perform this. I have managed to run some
sample HelloWorld apps and these run with no issues. My OS is ubuntu 12.04
and have OpenJDK and Oracle JDK installed. I have chosen the target
platform on eclipse to 1.6 but I get an error trying to compile this. The
errors are Dx* bad class file magic (cafebabe) or version (0033.0000)*.
Any suggestion what I might have missed here? What was your successful
development setup env like?

Regards,
Caesar

We recommend you start with the Android Tutorials to ensure that your
Eclipse development environment is set up correctly.

As detailed here:
https://code.google.com/p/opendatakit/wiki/CollectSourceCodeOverview
You need the playservices project to build ODK Collect.

I believe the tip is built with API 20 (i.e., Android 4.4.4). We have not
built it against the Android 5.x SDKs.

··· On Wed, May 20, 2015 at 10:03 PM, wrote:

Hello,

I am also trying to compile the ODK Collect from source using Eclipse but
with no luck.
Can someone post some detailed instructions on how to accomplish this?

Thanks

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Caesar,

I think you should checkout stackoverflow for this issue, here are some
links I found just by using your error description into google:



http://stackoverflow.com/questions/21246553/build-error-dx-bad-class-file-magic-cafebabe-or-version-0033-0000
http://www.codepond.org/posts/getting-around-bad-class-file-magic-with-only-jdk-1-7-installed

Usually its not a problem if you import google-play-services code into your
work space.

Ayub

Hi there,

I've also been trying to run Collect using Eclipse recently. I've been
encountering the error:

Conversion to Dalvik format failed: Unable to execute dex: Multiple dex
files define Lorg/javarosa/core/api/Constants;

though. The only workaround I've found to this error so far is to remove
either javarosa-libraries-osm.jar or javarosa-libraries-2015-04-17 (the app
does run without crashing if I remove either file). I assume I've simply
made some mistake in setting up the project, and the conflicting package
references aren't an actual issue?

Cheers,

Marshall

··· On Thursday, May 21, 2015 at 5:12:06 PM UTC+1, Mitch wrote: > > We recommend you start with the Android Tutorials to ensure that your > Eclipse development environment is set up correctly. > > As detailed here: > https://code.google.com/p/opendatakit/wiki/CollectSourceCodeOverview > You need the playservices project to build ODK Collect. > > I believe the tip is built with API 20 (i.e., Android 4.4.4). We have not > built it against the Android 5.x SDKs. > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >

You need to use Java 7.

Also, for ODK Collect, you need to download both the ODK Collect project,
and the PlayServices project from our site.

··· On Tue, Nov 11, 2014 at 7:40 AM, Ayub wrote:

Caesar,

I think you should checkout stackoverflow for this issue, here are some
links I found just by using your error description into google:

http://stackoverflow.com/questions/7866723/dx-bad-class-file-magic-cafebabe-or-version-0033-0000-with-adk14

http://stackoverflow.com/questions/20651651/dx-bad-class-file-magic-cafebabe-or-version-0033-0000-when-running-quickblox

http://stackoverflow.com/questions/21246553/build-error-dx-bad-class-file-magic-cafebabe-or-version-0033-0000

http://www.codepond.org/posts/getting-around-bad-class-file-magic-with-only-jdk-1-7-installed

Usually its not a problem if you import google-play-services code into
your work space.

Ayub

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Thanks for bringing this to my attention.

In general, you should not expect the tip of any of our code repos to build
and work. This is our working code tree, and we may have intermediate
check-ins at the tip while we hand off work amongst the developers or
integrate changes from various sources.

Tagged check-ins should build OK.

In this case, I missed a push of changes for the 1049 test build.

I have updated the tag and pushed the needed changes.

··· On Sun, May 31, 2015 at 10:35 AM, Marshall Bradley < marshallbradley93@gmail.com> wrote:

Hi there,

I've also been trying to run Collect using Eclipse recently. I've been
encountering the error:

Conversion to Dalvik format failed: Unable to execute dex: Multiple dex
files define Lorg/javarosa/core/api/Constants;

though. The only workaround I've found to this error so far is to remove
either javarosa-libraries-osm.jar or javarosa-libraries-2015-04-17 (the app
does run without crashing if I remove either file). I assume I've simply
made some mistake in setting up the project, and the conflicting package
references aren't an actual issue?

Cheers,

Marshall

On Thursday, May 21, 2015 at 5:12:06 PM UTC+1, Mitch wrote:

We recommend you start with the Android Tutorials to ensure that your
Eclipse development environment is set up correctly.

As detailed here:
https://code.google.com/p/opendatakit/wiki/CollectSourceCodeOverview
You need the playservices project to build ODK Collect.

I believe the tip is built with API 20 (i.e., Android 4.4.4). We have not
built it against the Android 5.x SDKs.

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Thanks all for your input. Your suggestions were very helpful. I managed to
compile it as suggested by loading the required libraries. It is however
worth mentioning that the compile and build worked successfully "for me" on
IntelliJ version 14.1 and JDK 1.7. Both build trials on Eclipse Juno and
Kepler resulted in an app that crashed on initialisation. Still challenging
connecting to the desired application (openxdata) but there's no better way
to learn than breaking and fixing. Thanks to you all for your input, once
again.

Regards,
Caesar

Great!

Mitch

··· On Tue, Nov 18, 2014 at 5:30 AM, Caesar K. Olima wrote:

Thanks all for your input. Your suggestions were very helpful. I managed
to compile it as suggested by loading the required libraries. It is however
worth mentioning that the compile and build worked successfully "for me" on
IntelliJ version 14.1 and JDK 1.7. Both build trials on Eclipse Juno and
Kepler resulted in an app that crashed on initialisation. Still challenging
connecting to the desired application (openxdata) but there's no better way
to learn than breaking and fixing. Thanks to you all for your input, once
again.

Regards,
Caesar

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com