V
V
Vadim2016-06-30 15:03:45
Java
Vadim, 2016-06-30 15:03:45

How to display Yandex maps in an Android application?

Good afternoon.
I did all the imports and registered everything as it should. Got a support key. In the markup, it throws a completely non-typical exception:

java.lang.NullPointerException
  at android.os.storage.StorageManager.getVolumeList(StorageManager.java:920)
  at android.os.Environment$UserEnvironment.getExternalDirs(Environment.java:87)
  at android.os.Environment.getExternalStorageState(Environment.java:730)
  at ah.d(Unknown Source)
  at ah.<init>(Unknown Source)
  at ru.yandex.yandexmapkit.MapController.<init>(Unknown Source)
  at ru.yandex.yandexmapkit.MapSurfaceView.init(Unknown Source)
  at ru.yandex.yandexmapkit.MapSurfaceView.<init>(Unknown Source)
  at ru.yandex.yandexmapkit.MapView.<init>(Unknown Source)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
  at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:465)
  at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:172)
  at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105)
  at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:176)
  at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:247)
  at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:171)
  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
  at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)
  at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
  at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:317)
  at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
  at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
  at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:520)
  at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:508)
  at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:967)
  at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:508)
  at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:75)
  at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:620)
  at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:617)
  at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:371)
  at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:617)
  at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:639)
  at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:654)
  at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:82)
  at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:596)
  at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
  at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
  at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
  at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
  at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
  at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:591)
  at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
  at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
  at com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:271)
  at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:286)
  at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:244)
  at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:234)
  at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
  at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)

The question is, how is it treated? :\

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Kazantsev, 2016-07-07
@saintbyte

As far as I remember, Yandex generally advises using webview

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question