Yandex MapKit 3.0崩溃

时间:2018-09-13 09:27:03

标签: android yandex-maps yandex-mapkit

Yandex MapKit在MapKitFactory.initialize(this)行崩溃

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    MapKitFactory.setApiKey(YANDEX_MAP_KEY)
    MapKitFactory.initialize(this)
    setContentView(R.layout.advert_activity)
}

Stacktrace是

  

java.lang.UnsatisfiedLinkError:dlopen失败:   “ /data/data/com.appname.app/app_lib/libgnustl_shared.so”是32位   而不是64位       在java.lang.Runtime.load0(Runtime.java:928)       在java.lang.System.load(System.java:1621)       在com.yandex.runtime.internal.ReLinker.loadLibrary(ReLinker.java:82)       在com.yandex.runtime.Runtime.loadLibrary(Runtime.java:122)       在com.yandex.runtime.Runtime.init(Runtime.java:99)       在com.yandex.mapkit.MapKitFactory.initialize(MapKitFactory.java:18)       在com.appname.main.MainActivity.onCreate(MainActivity.kt:41)       在android.app.Activity.performCreate(Activity.java:7023)       在android.app.Activity.performCreate(Activity.java:7014)       在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)       在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2745)       在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2870)       在android.app.ActivityThread.-wrap11(未知来源:0)       在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1601)       在android.os.Handler.dispatchMessage(Handler.java:106)       在android.os.Looper.loop(Looper.java:172)       在android.app.ActivityThread.main(ActivityThread.java:6590)       在java.lang.reflect.Method.invoke(本机方法)       在com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java:438)       在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

2 个答案:

答案 0 :(得分:1)

查看此问题https://github.com/yandex/mapkit-android-demo/issues/4/。 MapKit 3.0没有armv8。

答案 1 :(得分:0)

我已经尝试了所有方法,但只有该解决方案有效:

将此行添加到项目的build.gradle

android {
    defaultConfig {
        ndk {
            abiFilters "armeabi-v7a", "x86", 'armeabi', 'arm64-v8a'
        }

        packagingOptions {
            exclude '/lib/mips64/**'
            exclude '/lib/arm64-v8a/**'
            exclude '/lib/x86_64/**'
        }
    }
}