Whiskas333
@Whiskas333

Как отобразить Yandex карты в Android приложении?

Добрый день.
Сделал все импорты и всё прописал как надо. Ключ от поддержки получил. В разметке выбрасывает совсем не типичное исключение:

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)

Собственно вопрос, как это лечится? :\
  • Вопрос задан
  • 335 просмотров
Пригласить эксперта
Ответы на вопрос 1
saintbyte
@saintbyte
Django developer
Насколько я помню яндекс вообще советует использовать webview
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы