V
V
Vadim Popov2018-04-22 15:55:54
Android
Vadim Popov, 2018-04-22 15:55:54

Why are Yandex maps not loaded on Android, MapKit 3.0 library?

I use the free version of the MapKit library (3.0) for Android, while connecting the library there was a problem displaying the map itself.
After successfully connecting the library with the key:
MapKitFactory.setApiKey("Key received through the Yandex developer's personal account");
Maps are not loaded during application startup
5adc862dc5659471187730.png
Code Listing:

package popovvad.findme;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.yandex.mapkit.Animation;
import com.yandex.mapkit.MapKitFactory;
import com.yandex.mapkit.geometry.Point;
import com.yandex.mapkit.map.CameraPosition;
import com.yandex.mapkit.mapview.MapView;

public class MapActivity extends AppCompatActivity {

    private MapView mapView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MapKitFactory.setApiKey("Здесь мой ключ из кабинета разработчика яндекс");
        MapKitFactory.initialize(this);

        // Укажите имя activity вместо map.
        setContentView(R.layout.map_activity);
        mapView = (MapView)findViewById(R.id.mapview);
        mapView.getMap().move(
                new CameraPosition(new Point(55.751574, 37.573856), 11.0f, 0.0f, 0.0f),
                new Animation(Animation.Type.SMOOTH, 0),
                null);
    }

    @Override
    protected void onStop() {
        mapView.onStop();
        MapKitFactory.getInstance().onStop();
        super.onStop();
    }

    @Override
    protected void onStart() {
        super.onStart();
        MapKitFactory.getInstance().onStart();
        mapView.onStart();
    }
}

The following message is written to the log:
E/zygote: Failed sending reply to debugger: Broken pipe
E/yandex.maps: yandex::maps::runtime::network::common::DnsCache::resetLocalResolver: Invalid argumentfailed to parce address from web.adfox.ru.
E/yandex.maps: yandex::maps::runtime::network::common::DnsCache::resetLocalResolver: Invalid argumentfailed to parce address from web.adfox.ru.
I will be glad for any help and your answers, thank you very much :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Popov, 2018-04-24
@vadimpopov94

I contacted Yandex support, they sent a letter with the text that they activated my ApiKey on the server side, the problem was gone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question