Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7819705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:03:21+00:00 2026-06-02T07:03:21+00:00

I’m trying to use OSMdroid for a project, and i’m utterly unable to make

  • 0

I’m trying to use OSMdroid for a project, and i’m utterly unable to make the simplest code work.
Well, a few days ago i was able to display maps and so on, and now i can’t even instantiate a MapView.
I reduced the code to its sipmlest form.
I work with eclipse. I downloaded osmdroid-android-3.0.5.jar and slf4j-android-1.5.8.jar, and i included them in the project by adding lines to the classpath file

    <classpathentry kind="lib" path="lib/osmdroid-android-3.0.5.jar"/>
<classpathentry kind="lib" path="lib/slf4j-android-1.5.8.jar"/>

Or by right clicking on them then Build Path-> Add to build path (both gave the same result, anyway)

Then i typed this code:

import android.app.Activity;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapController;
import org.osmdroid.views.MapView;

import android.os.Bundle;

public class TestMapActivity extends Activity {
/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        MapView mv=new MapView(this,256);

    }
}

And i get a bug when running it on the emulator:

04-17 09:10:31.181: E/AndroidRuntime(595): FATAL EXCEPTION: main
04-17 09:10:31.181: E/AndroidRuntime(595): java.lang.NoClassDefFoundError:           org.osmdroid.views.MapView
04-17 09:10:31.181: E/AndroidRuntime(595):  at     testmap.sagem.TestMapActivity.onCreate(TestMapActivity.java:17)
04-17 09:10:31.181: E/AndroidRuntime(595):  at android.app.Activity.performCreate(Activity.java:4465)
04-17 09:10:31.181: E/AndroidRuntime(595):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-17 09:10:31.181: E/AndroidRuntime(595):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-17 09:10:31.181: E/AndroidRuntime(595):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-17 09:10:31.181: E/AndroidRuntime(595):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-17 09:10:31.181: E/AndroidRuntime(595):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-17 09:10:31.181: E/AndroidRuntime(595):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-17 09:10:31.181: E/AndroidRuntime(595):  at android.os.Looper.loop(Looper.java:137)
04-17 09:10:31.181: E/AndroidRuntime(595):  at android.app.ActivityThread.main(ActivityThread.java:4424)
04-17 09:10:31.181: E/AndroidRuntime(595):  at java.lang.reflect.Method.invokeNative(Native Method)
04-17 09:10:31.181: E/AndroidRuntime(595):  at java.lang.reflect.Method.invoke(Method.java:511)
04-17 09:10:31.181: E/AndroidRuntime(595):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-17 09:10:31.181: E/AndroidRuntime(595):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-17 09:10:31.181: E/AndroidRuntime(595):  at dalvik.system.NativeStart.main(Native Method)

When i comment out the “MapView mv=new MapView(this,256);” it works, so i don’t understand why the mapview can’t be instantiated.

Any idea on this?

Thank you for your attention.

EDIT:
The AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="testmap.sagem"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk android:minSdkVersion="15" />
<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".TestMapActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
</manifest>

The main.xml file:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
</LinearLayout>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:03:21+00:00Added an answer on June 2, 2026 at 7:03 am

    Change Folder name “lib” to “libs” and put all jar files in that folder and Charge path of jar
    files to “libs” folder. I am not sure but I think it will work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.