gpt4 book ai didi

android - 初始化百度 map SDK时出现UnsatisfiedLinkError

转载 作者:行者123 更新时间:2023-12-03 05:47:10 24 4
gpt4 key购买 nike

我正在尝试将百度Map SDK集成到我的Android应用程序中。

库的结构:

enter image description here

导致此代码出现问题:

SDKInitializer.initialize(applicationContext)

错误日志:
    03-27 00:57:26.557 18050-18050/com.emerson.oversight E/NativeLoader: found libBaiduMapSDK_base_v4_5_2.so error
03-27 00:57:26.558 18050-18050/com.emerson.oversight E/art: No implementation found for int com.baidu.platform.comjni.tools.JNITools.initClass(java.lang.Object, int) (tried Java_com_baidu_platform_comjni_tools_JNITools_initClass and Java_com_baidu_platform_comjni_tools_JNITools_initClass__Ljava_lang_Object_2I)
03-27 00:57:26.560 18050-18050/com.emerson.oversight D/AndroidRuntime: Shutting down VM


--------- beginning of crash
03-27 00:57:26.562 18050-18050/com.emerson.oversight E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.emerson.oversight, PID: 18050
java.lang.UnsatisfiedLinkError: No implementation found for int com.baidu.platform.comjni.tools.JNITools.initClass(java.lang.Object, int) (tried Java_com_baidu_platform_comjni_tools_JNITools_initClass and Java_com_baidu_platform_comjni_tools_JNITools_initClass__Ljava_lang_Object_2I)
at com.baidu.platform.comjni.tools.JNITools.initClass(Native Method)
at com.baidu.platform.comjni.tools.a.b(Unknown Source)
at com.baidu.platform.comapi.a.<clinit>(Unknown Source)
at com.baidu.platform.comapi.a.a(Unknown Source)
at com.baidu.platform.comapi.c.a(Unknown Source)
at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source)
at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source)
at oversight.controller.ui.activities.BaiduMapActivity.onCreate(BaiduMapActivity.kt:84)
at android.app.Activity.performCreate(Activity.java:6977)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
lll

最佳答案

应用程序级别(而非顶级级别)的build.gradle文件应为:

apply plugin: 'com.android.application'

repositories {
flatDir {
dir 'libs'
}
}

android {

// Stuff ...

sourceSets {
main {
jniLibs.srcDir 'libs'
}
}

// Stuff ...
}

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

// Stuff..
}

关于android - 初始化百度 map SDK时出现UnsatisfiedLinkError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49499328/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com