Android集成银联支付,提示java.lang.UnsatisfieldLinkError错误

尽管解决方法很简单,但还是记录一下吧。

最近做银联支付(Android),官方给的demo是eclipse的。按照官方(https://open.unionpay.com/ajweb/product)给的步骤,在Android studio中一步一步集成。运行出错,提示

java.lang.UnsatisfieldLinkError: Couldn't load entryexpro from loader dalvik.system.PathClassLoader...

Android集成银联支付,提示java.lang.UnsatisfieldLinkError错误_第1张图片

04-11 16:18:56.803: E/AndroidRuntime(23491): FATAL EXCEPTION: main
04-11 16:18:56.803: E/AndroidRuntime(23491): Process: com.qingdaonews.uppaydemo, PID: 23491
04-11 16:18:56.803: E/AndroidRuntime(23491): java.lang.UnsatisfiedLinkError: com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader[DexPathList[[dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-support-annotations-22.2.1_db1bb2a3f1608a31c38a2d1f5698fe71cc45038a-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-internal_impl-22.2.1_171ce1a695f673e02df78c666fcc53aa6154c34a-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-com.android.support-support-v4-22.2.1_98e1b0d1376b944470d7fff88c63146b0a00e4c4-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-com.android.support-appcompat-v7-22.2.1_f190b0f2e0a311328493251e2d423cf0dc13014a-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-UPPayPluginExPro_c84e63b6153546347c9ae1bb49500874c4020212-classes.dex", dex file "/data/data/com.qingdaonews.uppaydemo/files/instant-run/dex/slice-UPPayAssistEx_97ef3cf4f27d3e797e1e7fb313ab8116cf6fc7c6-classes.dex"],nativeLibraryDirectories=[/data/app/com.qingdaonews.uppaydemo-2/lib/arm, /system/lib, /vendor/lib]]] couldn't find "libentryexpro.so"
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at java.lang.Runtime.loadLibrary0(Runtime.java:984)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at java.lang.System.loadLibrary(System.java:1530)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.unionpay.UPPayAssistEx.s(Unknown Source)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.unionpay.UPPayAssistEx.o(Unknown Source)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.unionpay.c.onError(Unknown Source)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.unionpay.b.b.a(Unknown Source)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.unionpay.b.b.a(Unknown Source)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.unionpay.UPPayAssistEx.a(Unknown Source)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.unionpay.UPPayAssistEx.a(Unknown Source)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.unionpay.UPPayAssistEx.startPay(Unknown Source)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.unionpay.uppayplugin.demo.JARActivity.doStartUnionPayPlugin(JARActivity.java:11)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.unionpay.uppayplugin.demo.BaseActivity.handleMessage(BaseActivity.java:109)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at android.os.Handler.dispatchMessage(Handler.java:98)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at android.os.Looper.loop(Looper.java:154)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at android.app.ActivityThread.main(ActivityThread.java:6126)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at java.lang.reflect.Method.invoke(Native Method)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
04-11 16:18:56.803: E/AndroidRuntime(23491): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

官方文档中也提到了这个问题,关于so文件的,按照官方解决方法也没有解决。代码是从demo中拷的,很奇怪怎么会出问题。

用Android studio通过import project的方式打开eclipse版的官方demo,才意识到,是so文件放错地方了,so文件应该放在jniLibs文件夹中

Android集成银联支付,提示java.lang.UnsatisfieldLinkError错误_第2张图片


运行通过。


转自:https://www.cnblogs.com/touchmore/p/5637809.html





你可能感兴趣的:(环境配置,android,studio)