P
P
Pavel Ivanov2014-07-24 08:48:53
Android
Pavel Ivanov, 2014-07-24 08:48:53

How to connect Yandex MapKit to Android Studio?

I'm struggling with the problem of connecting Yandex MapKit to Android Studio. Tried different ways. Always gives the same error. What could be the problem?

07-24 13:42:11.919  24970-24970/ru.orionnet.simplemaps D/dalvikvm﹕ Trying to load lib /data/data/ru.orionnet.simplemaps/lib/libcache_local.so 0x2bde87d8
07-24 13:42:11.999  24970-24970/ru.orionnet.simplemaps D/dalvikvm﹕ Added shared lib /data/data/ru.orionnet.simplemaps/lib/libcache_local.so 0x2bde87d8
07-24 13:42:11.999  24970-24970/ru.orionnet.simplemaps D/dalvikvm﹕ No JNI_OnLoad found in /data/data/ru.orionnet.simplemaps/lib/libcache_local.so 0x2bde87d8, skipping init
07-24 13:42:12.059  24970-24970/ru.orionnet.simplemaps D/ru.yandex.OpenKODE﹕ android.cpp.mountSharedFileSystem()
07-24 13:42:12.059  24970-24970/ru.orionnet.simplemaps D/ru.yandex.OpenKODE﹕ android.cpp.mountSharedFileSystem()[shared fs mounted to: /mnt/sdcard]
07-24 13:42:12.249  24970-24970/ru.orionnet.simplemaps W/dalvikvm﹕ VFY: unable to resolve static field 9393 (ymk_map_layers) in Lru/yandex/yandexmapkit/R$xml;
07-24 13:42:12.249  24970-24970/ru.orionnet.simplemaps D/dalvikvm﹕ VFY: replacing opcode 0x60 at 0x005e
07-24 13:42:12.279  24970-24972/ru.orionnet.simplemaps D/dalvikvm﹕ GC_CONCURRENT freed 223K, 4% free 9054K/9415K, paused 10ms+2ms
07-24 13:42:12.289  24970-24970/ru.orionnet.simplemaps W/dalvikvm﹕ VFY: unable to resolve static field 9387 (ymk_screen_buttons_layout) in Lru/yandex/yandexmapkit/R$layout;
07-24 13:42:12.289  24970-24970/ru.orionnet.simplemaps D/dalvikvm﹕ VFY: replacing opcode 0x60 at 0x000b
07-24 13:42:12.309  24970-24970/ru.orionnet.simplemaps W/dalvikvm﹕ VFY: unable to resolve static field 9390 (ymk_lang) in Lru/yandex/yandexmapkit/R$string;
07-24 13:42:12.309  24970-24970/ru.orionnet.simplemaps D/dalvikvm﹕ VFY: replacing opcode 0x60 at 0x0005
07-24 13:42:12.319  24970-24970/ru.orionnet.simplemaps D/AndroidRuntime﹕ Shutting down VM
07-24 13:42:12.319  24970-24970/ru.orionnet.simplemaps W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x2b542210)
07-24 13:42:12.339  24970-24970/ru.orionnet.simplemaps E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{ru.orionnet.simplemaps/ru.orionnet.simplemaps.YandexMapActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class ru.yandex.yandexmapkit.MapView
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class ru.yandex.yandexmapkit.MapView
            at android.view.LayoutInflater.createView(LayoutInflater.java:606)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
            at android.app.Activity.setContentView(Activity.java:1835)
            at ru.orionnet.simplemaps.YandexMapActivity.onCreate(YandexMapActivity.java:14)
            at android.app.Activity.performCreate(Activity.java:4465)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
            at android.view.LayoutInflater.createView(LayoutInflater.java:586)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
            at android.app.Activity.setContentView(Activity.java:1835)
            at ru.orionnet.simplemaps.YandexMapActivity.onCreate(YandexMapActivity.java:14)
            at android.app.Activity.performCreate(Activity.java:4465)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NoClassDefFoundError: ru.yandex.yandexmapkit.R$string
            at ck.a(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 java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
            at android.view.LayoutInflater.createView(LayoutInflater.java:586)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
            at android.app.Activity.setContentView(Activity.java:1835)
            at ru.orionnet.simplemaps.YandexMapActivity.onCreate(YandexMapActivity.java:14)
            at android.app.Activity.performCreate(Activity.java:4465)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)

Who can describe a working way to connect the library to Android Studio?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Ivanov, 2014-07-24
@eastywest

Found a solution
Removed such a piece of code from the build.gradle module yandexmapkitlibrary

sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')

// Move the build types to build-types/
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src//... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}

and everything worked well

P
pirogtm, 2020-09-01
@pirogtm

Encountered a map crash when used in a fragment. Version 3.5.0. Downgrading to version 3.2.0 helped. Maybe someone will be useful.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question