java.lang.UnsatisfiedLinkError:找不到本机方法:org.strongswan.android.logic.CharonVpnService.initializeCharon

时间:2017-01-09 11:04:47

标签: android java-native-interface

我正在尝试在我的Java类中编写本机方法,但是我遇到了错误 任何人都可以帮助我,下面是日志错误消息

登录

01-09 16:15:48.154 8677-9092/org.strongswan.android D/dalvikvm: VFY: replacing opcode 0x60 at 0x0058
01-09 16:15:48.154 8677-9092/org.strongswan.android W/dalvikvm: VFY: unable to resolve static field 8805 (AF_INET6) in Landroid/system/OsConstants;
01-09 16:15:48.154 8677-9092/org.strongswan.android D/dalvikvm: VFY: replacing opcode 0x60 at 0x0090
01-09 16:15:48.154 8677-9092/org.strongswan.android W/dalvikvm: No implementation found for native Lorg/strongswan/android/logic/CharonVpnService;.initializeCharon:(Lorg/strongswan/android/logic/CharonVpnService$BuilderAdapter;Ljava/lang/String;Z)Z
01-09 16:15:48.154 8677-9092/org.strongswan.android W/dalvikvm: threadid=14: thread exiting with uncaught exception (group=0x419ced58)
01-09 16:15:48.154 8677-9092/org.strongswan.android E/AndroidRuntime: FATAL EXCEPTION: Thread-505
                                                                      Process: org.strongswan.android, PID: 8677
                                                                      java.lang.UnsatisfiedLinkError: Native method not found: org.strongswan.android.logic.CharonVpnService.initializeCharon:(Lorg/strongswan/android/logic/CharonVpnService$BuilderAdapter;Ljava/lang/String;Z)Z
                                                                          at org.strongswan.android.logic.CharonVpnService.initializeCharon(Native Method)
                                                                          at org.strongswan.android.logic.CharonVpnService.run(CharonVpnService.java:225)
                                                                          at java.lang.Thread.run(Thread.java:841)
01-09 16:15:48.164 8677-8677/org.strongswan.android D/android.widget.GridLayout: horizontal constraints: x2-x0>=640, x2-x1<=253, x1-x0<=136 are inconsistent; permanently removing: x2-x1<=253. 

的build.gradle

enter image description here

1 个答案:

答案 0 :(得分:0)

消息说它正在寻找`Lorg / strongswan / android / logic / CharonVpnService; .initializeCharon“(这有点奇怪),但找不到它。这意味着找不到包含此代码的库,或者方法签名错误,因此无法找到该功能。从您提供的详细信息来看,很难说更多。