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.UnsisfiedLinkError: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(ActivityThreads.java:2745)在android.app.ActivityThread.handleLaunchActivity(ActivityThreads.java:2870)在android.app.ActivityThread.-wrap11(未知来源:0)在android.app.ActivityThread$H.handleMessage(ActivityThreads.java:1601)在android.os.Handler.dispatchMessage(Handler.java:106)在android.os.Looper.loop(Looper.java:172)在android.app.ActivityThread.main(ActivityThreads.java:6590)位于java.lang.reflect.Method.ioke(本机方法)网址:com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)网址:com.android.internal.os.ZygoteInit.main(ZygoteNit.java:807)
看看这个问题https://github.com/yandex/mapkit-android-demo/issues/4/.MapKit 3.0没有armv8。
我尝试了所有的方法,但只有那个解决方案有效:
将此行添加到项目的build.gradle
android {
defaultConfig {
ndk {
abiFilters "armeabi-v7a", "x86", 'armeabi', 'arm64-v8a'
}
packagingOptions {
exclude '/lib/mips64/**'
exclude '/lib/arm64-v8a/**'
exclude '/lib/x86_64/**'
}
}
}