[VTM] cannot build vtm-android-example

190 views
Skip to first unread message

Jonas W

unread,
Aug 25, 2017, 1:38:29 PM8/25/17
to mapsforge-dev
Hello,

when I try to build the vtm-android-example with the latest android studio I get following error:

Information:Gradle tasks [:vtm-android-example:assembleDebug]
Error:Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Exception parsing classes
Error:1 error; aborting
Error:Execution failed for task ':vtm-android-example:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
Information:BUILD FAILED
Information:Total time: 16.5 secs
Information:3 errors
Information:0 warnings
Information:See complete output in console


Does anyone know why this happens?

Doing a gradlew build in the console works!

Emux

unread,
Aug 25, 2017, 1:42:01 PM8/25/17
to mapsfo...@googlegroups.com, Jonas W
Can you provide more details?

- Do you clone the latest VTM without any changes ?

- Do you use latest Android Studio release 2.3.3 ?


> when I try to build

What do you mean? How exactly do you try to build it, via AS menu?

--
Emux

Jonas W

unread,
Aug 25, 2017, 1:43:16 PM8/25/17
to mapsforge-dev, jonaswi...@gmail.com
Yes, no changes in the VTM code, latest code
Yes, latest Android Studio release

Jonas W

unread,
Aug 25, 2017, 1:46:18 PM8/25/17
to mapsforge-dev, jonaswi...@gmail.com
How I built: I just selected vtm-android-example as run configuration and hit the play button

Emux

unread,
Aug 25, 2017, 1:48:47 PM8/25/17
to mapsfo...@googlegroups.com, Jonas W
On 25/08/2017 08:46 μμ, Jonas W wrote:
How I built: I just selected vtm-android-example as run configuration and hit the play button

That should work too.

Or can try a full clean / rebuild from the menu for all modules first.

BTW I suppose you have installed the required Android SDK 26 with build tools 26.0.1 ?

--
Emux

Jonas W

unread,
Aug 25, 2017, 2:21:29 PM8/25/17
to mapsforge-dev, jonaswi...@gmail.com
Thank you Emux! I uninstalled Android SDK 25, and now it works!

vklein

unread,
Sep 15, 2017, 11:36:54 AM9/15/17
to mapsforge-dev

I try to build the vtm-android-example  with the latest android studio 2.3.3 , Android 8.0.0 Rev 2 and SDK Build-tools 26.0.1 and get the error:


Information:Gradle tasks [:vtm-android-example:assembleDebug]
Error:Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Exception parsing classes
Error:1 error; aborting
Error:Execution failed for task ':vtm-android-example:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
Information:BUILD FAILED
Information:Total time: 12.259 secs

Information:3 errors
Information:0 warnings
Information:See complete output in console

last lines in the console:
....
:vtm-android-example:incrementalDebugTasks UP-TO-DATE
:vtm-android-example:preColdswapDebug
:vtm-android-example:transformClassesWithInstantRunSlicerForDebug UP-TO-DATE
:vtm-android-example:transformClassesWithDexForDebug
AGPBI: {"kind":"error","text":"Error converting bytecode to dex:\nCause: java.lang.RuntimeException: Exception parsing classes","sources":[{}],"original":"UNEXPECTED TOP-LEVEL EXCEPTION:\njava.lang.RuntimeException: Exception parsing classes\n\tat com.android.dx.command.dexer.Main.processClass(Main.java:781)\n\tat com.android.dx.command.dexer.Main.processFileBytes(Main.java:747)\n\tat com.android.dx.command.dexer.Main.access$1200(Main.java:88)\n\tat com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1689)\n\tat com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)\n\tat com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)\n\tat com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)\n\tat com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)\n\tat com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)\n\tat com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)\n\tat com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)\n\tat com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)\n\tat com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)\n\tat com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)\n\tat com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)\n\tat com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)\n\tat com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)\n\tat com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)\n\tat com.android.dx.command.dexer.Main.processOne(Main.java:695)\n\tat com.android.dx.command.dexer.Main.processAllFiles(Main.java:592)\n\tat com.android.dx.command.dexer.Main.runMultiDex(Main.java:376)\n\tat com.android.dx.command.dexer.Main.run(Main.java:290)\n\tat com.android.builder.internal.compiler.DexWrapper.run(DexWrapper.java:54)\n\tat com.android.builder.core.DexByteCodeConverter.lambda$dexInProcess$0(DexByteCodeConverter.java:174)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\nCaused by: com.android.dx.cf.iface.

ParseException: class name (org/oscim/tiling/source/geojson/GeoJsonTileSource) does not match path (org/oscim/tiling/source/geojson/GeojsonTileSource.class)\n

\tat com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520)\n\tat com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)\n\tat com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)\n\tat com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)\n\tat com.android.dx.command.dexer.Main.parseClass(Main.java:793)\n\tat com.android.dx.command.dexer.Main.access$1600(Main.java:88)\n\tat com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1728)\n\tat com.android.dx.command.dexer.Main.processClass(Main.java:779)\n\t... 27 more\n","tool":"Dex"}
AGPBI: {"kind":"error","text":"1 error; aborting","sources":[{}]}

 FAILED
:vtm-android-example:buildInfoGeneratorDebug

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':vtm-android-example:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 12.259 secs

I have removed build tools 25.01 and 25.02 ,  SDK 23  is installed and 26 partially

gradle builds  vtm-app , works on the device
gradle builds vtm-android-gdx , works on the device , but shows only the Grid Layer with tiles 2/1/1 , 2/2/1,

new gradle build with vtm-android-example
same error as above mentioned
I found the class GeoJsonTileSource in vtm-extras/java/org.oscim/tiling.source/geojson/GeoJsonTileSource    , the package is org.oscim.tiling.source.geojson
path on the machine: G:\....\vtm-master\vtm-extras\src\org\oscim\tiling\source\geojson\GeoJsonTileSource.java

Any suggestions for vtm-android-example?

Emux

unread,
Sep 15, 2017, 11:59:04 AM9/15/17
to mapsfo...@googlegroups.com
> gradle builds vtm-android-gdx , works on the device , but shows only the Grid Layer with tiles 2/1/1 , 2/2/1,

Probably OSciM tile server problem, not related to VTM.


Have you cloned a clean VTM to avoid any corrupted cache?
Or perform a clean and then a full rebuild first, before running anything.

Travis works fine, so could be some configuration problem.

--
Emux

Emux

unread,
Sep 15, 2017, 12:43:44 PM9/15/17
to mapsfo...@googlegroups.com
In any case I removed the unneeded "vtm-extras" dependency from vtm-android-example, to avoid such possible conflicts.

So could you do a new clone of latest VTM and perform a full clean / rebuild?

--
Emux

vklein

unread,
Sep 15, 2017, 2:49:39 PM9/15/17
to mapsforge-dev
It took some time to remove skd 23  and install sdk 26
Then downloaded the latest vtm-master.zip , unpacked and opened in studio a a existing project

Success: 0 errors

Now vtm-android-example is build and runs on the device (acer zeest liquid with Android 6)

Thank you very much for adding the poi search to vtm-example.





Reply all
Reply to author
Forward
0 new messages