0

我正在尝试使用 maven 中央依赖启动基本的自适应卡示例,但由于未找到本机方法 impl 而出现错误。

我刚刚将依赖项添加到我的 build.gradle:

compile 'io.adaptivecards:adaptivecards-android-arm:1.0.0'

这是错误:

11-13 18:19:55.944 16684-16970 E/zygote: No implementation found for long com.microsoft.adaptivecards.objectmodel.AdaptiveCardObjectModelJNI.AdaptiveCard_DeserializeFromString(java.lang.String) (tried Java_com_microsoft_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_AdaptiveCard_1DeserializeFromString and Java_com_microsoft_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_AdaptiveCard_1DeserializeFromString__Ljava_lang_String_2)
11-13 18:19:55.945 16684-16684 D/AndroidRuntime: Shutting down VM
11-13 18:19:55.949 16684-16684 E/AndroidRuntime: FATAL EXCEPTION: main
                                                 Process: com.tuenti.messenger, PID: 16684
                                                 java.lang.UnsatisfiedLinkError: No implementation found for long com.microsoft.adaptivecards.objectmodel.AdaptiveCardObjectModelJNI.AdaptiveCard_DeserializeFromString(java.lang.String) (tried Java_com_microsoft_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_AdaptiveCard_1DeserializeFromString and Java_com_microsoft_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_AdaptiveCard_1DeserializeFromString__Ljava_lang_String_2)
                                                     at com.microsoft.adaptivecards.objectmodel.AdaptiveCardObjectModelJNI.AdaptiveCard_DeserializeFromString(Native Method)
                                                     at com.microsoft.adaptivecards.objectmodel.AdaptiveCard.DeserializeFromString(AdaptiveCard.java:105)

我检查了生成的 APK,它包含自适应卡的 SO,但仍然无法正常工作。

4

1 回答 1

1

在访问 API 之前尝试添加一个静态 ctor,看看是否有帮助。

static { 
    System.loadLibrary("adaptivecards-native-lib"); 
}
于 2017-11-14T23:15:58.787 回答