-1

I have a problem while developing an Android App with a simple Open Street Map Acitivity. My AVD shows a empty map and the log says:

>     W/System: ClassLoader referenced unknown path: /data/app/com.example.philipp.myapplication-1/lib/x86_64
>     I/OsmDroid: Using tile source: Mapnik
>     E/OsmDroid: unable to create a nomedia file. downloaded tiles may be visible to the gallery. open failed: ENOENT (No such file or
> directory)
>     I/OsmDroid: sdcard state: mounted

This is my MainActivity:

import android.app.Activity;
import android.os.Bundle;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.views.MapView;

public class MainActivity extends Activity {
    @Override public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        MapView map = (MapView) findViewById(R.id.map);
        map.setTileSource(TileSourceFactory.MAPNIK);
    }
}

I haven't found anything at my online researches. And I'm not sure if this is a code or emulator problem..

Thanks for your help! If you need more information, let me know!

Philipp
  • 1
  • 1

2 Answers2

1

I might have a solution for you:
In my case the solution was to give permissions to use location and storage to my application in the android settings. Because i did not use the latest permission model, the application did not have the necessary permission to write storage and provide tiles.

tob1
  • 11
  • 2
0
//onde mostra a imagem do mapa
Context ctx = getApplicationContext();
Configuration.getInstance().load(ctx, PreferenceManager.getDefaultSharedPreferences(ctx));

use this code within on create

Josileudo Rodrigues
  • 1,979
  • 1
  • 6
  • 9