Update OsmAnd build instructions?

522 views
Skip to first unread message

Andrew Davie

unread,
Mar 9, 2016, 6:13:19 AM3/9/16
to Osmand
I would like to start building OsmAnd.
These seem to be quite out of date. I am trying to follow the section "How to INstall the Development Environment"
For example, the JDK link is broken https://jdk6.dev.java.net/
I tried to find the JDK but versions stopped numbering at 1.3.  It goes something like 1.1, 1.2, 1.3 then SE 5, SE 6. Do I assume SE 6 is the same as 1.6?
I installed Eclipse, but when trying Android Development Tools, I am advised to forget that, and go to Android Studio.
I installed Android Studio, but the OsmAnd project is clearly an Eclipse project. An import failed.
So, back to Eclipse...?  I don't agree with the instructions "installation is simple"!!
I'm just finding things a bit difficult as I am making lots of assumptions and it just seems that it should all be simpler.
Thanks for any help.



Jay

unread,
Mar 9, 2016, 11:33:43 AM3/9/16
to Osmand
Similar problems here as well, an updated development environment installation guide is necessary.

Harry van der Wolf

unread,
Mar 10, 2016, 10:37:56 AM3/10/16
to osmand
Your best change might be the https://code.google.com/archive/p/osmand/wikis/GradleCommandLineBuildEnvironment.wiki
I wrote that 1½ year ago or so, but that one might not be up-to-date as well. It has never been migrated.
It is definitely 1000% (yes 1000) more up-to-date then the migrated article  you both have been trying to use, as that one was already 4 years ago outdated.


Harry

2016-03-09 17:33 GMT+01:00 'Jay' via Osmand <osm...@googlegroups.com>:
Similar problems here as well, an updated development environment installation guide is necessary.

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

Harry van der Wolf

unread,
Mar 10, 2016, 10:38:47 AM3/10/16
to osmand


2016-03-10 16:37 GMT+01:00 Harry van der Wolf <hvd...@gmail.com>:
Your best change might 

"chance" of course.

Andrew Davie

unread,
Mar 11, 2016, 10:20:35 AM3/11/16
to osm...@googlegroups.com
Thanks for the link. I got a long way through the compile - 97% - and just have this error to sort…
Can anyone help/?



:OsmAnd:dexFullLegacyFatDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
at com.android.dx.command.dexer.Main.processClass(Main.java:752)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:672)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:542)
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)
at com.android.dx.command.dexer.Main.run(Main.java:275)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
at com.android.dx.command.dexer.Main.processClass(Main.java:749)
... 12 more
warning: Ignoring InnerClasses attribute for an anonymous inner class
(bsh.CollectionManager$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(bsh.Interpreter$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(bsh.SimpleNode$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
at com.android.dx.command.dexer.Main.processClass(Main.java:752)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:672)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:569)
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)
at com.android.dx.command.dexer.Main.run(Main.java:275)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
at com.android.dx.command.dexer.Main.processClass(Main.java:749)
... 12 more
2 errors; aborting

:OsmAnd:dexFullLegacyFatDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':OsmAnd:dexFullLegacyFatDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1


Thanks!

Max

unread,
Mar 12, 2016, 3:09:37 AM3/12/16
to Osmand
> bad class file magic (cafebabe) or version (0034.0000)

Likely Java 8 is the problem, try Java 7.

Regards,
Max

Andrew Davie

unread,
Mar 12, 2016, 6:06:12 AM3/12/16
to osm...@googlegroups.com
That was the problem. Up and running now.
I appreciate your help, thanks!
Cheers
A


Florent Angly

unread,
May 24, 2016, 7:03:03 AM5/24/16
to Osmand
Thank you, Harry! I appreciate your documentation of the build process since it has helped me build the apk a few months ago.

I must add that I added a few extra steps to install the debug/bleeding-edge apk on my phone directly through USB, alongside the official app release:

1/ First apply a patch to give the app a different name:
*** ./android/OsmAnd/build.gradle 2015-11-14 17:49:16.394229886 +0100
--- ./android/OsmAnd/build_patched.gradle 2015-11-14 17:56:53.265954571 +0100
***************
*** 140,145 ****
--- 140,146 ----
  
   buildTypes {
   debug {
applicationIdSuffix '.debug'
   // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
   // minifyEnabled true

2/ Then build the assembleFullLegacyFatDebug target, as you described

3/ Finally, install the apk on the phone (via USB):
adb install -r OsmAnd-full-legacy-fat-debug.apk
 
Perhaps you could update the documentation with this information?


However, I have just tried to build the app again and encounter some issues when installing using adb:
Failure [INSTALL_FAILED_CONFLICTING_PROVIDER]

I have been unsuccessful at solving this issue thus far. Any idea how to fix it?

Cheers,
Florent


Andrew Davie

unread,
May 24, 2016, 7:09:03 AM5/24/16
to osm...@googlegroups.com
I’d guess you have a copy of OsmAnd on your phone and you’re trying to install a home-built copy.
Different sources, so the system complains.  Delete the one on your phone and try again.
Just a guess, but that’s what I’d interpret this one as :)



However, I have just tried to build the app again and encounter some issues when installing using adb:
Failure [INSTALL_FAILED_CONFLICTING_PROVIDER]

I have been unsuccessful at solving this issue thus far. Any idea how to fix it?

Cheers,
Florent



Andy Townsend

unread,
May 24, 2016, 8:17:53 AM5/24/16
to osm...@googlegroups.com
On 24/05/2016 12:08, Andrew Davie wrote:
> I’d guess you have a copy of OsmAnd on your phone and you’re trying to
> install a home-built copy.
> Different sources, so the system complains. Delete the one on your
> phone and try again.
> Just a guess, but that’s what I’d interpret this one as :)

Yes - more details should they be needed:

http://stackoverflow.com/questions/16267785/install-shows-error-in-console-install-failed-conflicting-provider

Cheers,

Andy

(haven't built OsmAnd for some years, but saw exactly this error a
couple of days ago with something else)

Harry van der Wolf

unread,
May 24, 2016, 8:31:54 AM5/24/16
to osmand
2016-05-24 13:03 GMT+02:00 Florent Angly <floren...@gmail.com>:

 
Perhaps you could update the documentation with this information?


Thanks for  reporting back.

I think I will simply copy the article, extend it with your remarks, and deliver it as a pull-request to the new wiki. I did that already with another non-migrated article as well.

I also saw on the build server (http://builder.osmand.net:8080/), where you can also follow the build log of the osmand builds (log logs, takes time), that there was a GRADLE change. So obviously "something" has changed but I did not look into it (yet?).


Harry

Florent Angly

unread,
May 25, 2016, 4:10:12 PM5/25/16
to Osmand
Thanks everybody, your answers have allowed me to get the debug version of OsmAnd built and installed alongside the official release on my smartphone.
I have opened a pull request at https://github.com/osmandapp/Osmand/pull/2598 , which details the few lines I had to change in build.gradle and AndroidManifest.xml

Reply all
Reply to author
Forward
0 new messages