OSMDroid osmdroid-android-it Project Fails to Compile

1k views Asked by At

I downloaded the official OSMdroid example from here. https://github.com/osmdroid/osmdroid and unable to get the osmdroid-android-it Android app to compile on latest Eclipse IDE with Android SDK. I tried with API 10 and 17.

I downloaded and include current osmdroid-android-3.0.8.jar and slf4j-android-1.5.8.jar in your project per http://android-er.blogspot.com/2012/05/prepare-java-build-path-to-osmdroid-and.html. enter image description here

enter image description here

Still the osmdroid-android-it project does not recognize OSMDROID libraries under src folder.

I need is custom MBTiles working OSMDroid example similar to following: http://www.sieswerda.net/2012/08/15/upping-the-developer-friendliness/

I have downloaded MBTiles example from here: https://github.com/djcoin/MBTilesOsmdroidExample same issue with OSMDroid .jar file. Unable to recognize the OSMDroid library.

What i need is Android version of custom map app similar to this iphone airplane chart one.

Here is the screenshot of my compiling errors.

enter image description here

AndroidManifest.xml

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.osmdroid.test" android:versionCode="1" android:versionName="4.3-SNAPSHOT">

<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="16"/>

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <uses-library android:name="android.test.runner"/>
</application>

<instrumentation android:targetPackage="org.osmdroid"
                 android:name="android.test.InstrumentationTestRunner"/>

The pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>org.osmdroid</groupId>
    <artifactId>osmdroid-parent</artifactId>
    <version>4.3-SNAPSHOT</version>
</parent>

<artifactId>osmdroid-android-it</artifactId>
<version>4.3-SNAPSHOT</version>
<packaging>apk</packaging>
<name>osmdroid-android-it - Integration tests</name>

<dependencies>
    <dependency>
        <groupId>android</groupId>
        <artifactId>android</artifactId>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.osmdroid</groupId>
        <artifactId>OpenStreetMapViewer</artifactId>
        <type>apk</type>
        <version>4.3-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.osmdroid</groupId>
        <artifactId>OpenStreetMapViewer</artifactId>
        <type>jar</type>
        <version>4.3-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.osmdroid</groupId>
        <artifactId>osmdroid-android</artifactId>
        <type>jar</type>
        <version>4.3-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <finalName>${project.artifactId}</finalName>
    <plugins>
        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <configuration>
                <test>
                    <!--<skip>true|false|auto</skip> -->
                    <!--<instrumentationPackage>packageName</instrumentationPackage> -->
                    `
                    <!--<instrumentationRunner>className</instrumentationRunner> -->
                    <!--<debug>true|false</debug> -->
                    <!--<coverage>true|false</coverage> -->
                    <!--<logonly>true|false</logonly> avd -->
                    <!--<testsize>small|medium|large</testsize> -->
                    <createReport>true</createReport>
                    <!--<classes> -->
                    <!--<class>your.package.name.YourTestClass</class> -->
                    <!--</classes> -->
                    <!--<packages> -->
                    <!--<package>your.package.name</package> -->
                    <!--</packages> -->
                </test>
            </configuration>
            <extensions>true</extensions>
        </plugin>
    </plugins>
</build>

1

There are 1 answers

1
MKer On

1) Current osmdroid version is v4.2. v3.0.8 is completely obsolete, and will not work with current OSM Mapnik server.

2) You are using simultaneously jar libs inclusion (with 3.0.8) AND Maven (with 4.3-SNAPSHOT). You have to choose one of these methods. See https://github.com/osmdroid/osmdroid/wiki/HowToMaven