集成阿里百川SDK的时候遇到下面报错,查询了一下阿里百川文档的错误码发现是SDK初始化失败的原因。
阿里百川开发者平台:http://console.baichuan.taobao.com/authimg.htm
com.alibaba.wireless.security.open.SecException:
at com.taobao.wireless.security.adapter.JNICLibrary.doCommandNative(Native Method)
at com.alibaba.wireless.security.a.j.a.getAppKeyByIndex(Unknown Source)
at com.alibaba.baichuan.trade.common.adapter.security.c.a(Unknown Source)
at com.alibaba.baichuan.trade.common.adapter.security.AlibcSecurityGuard.init(Unknown Source)
at com.alibaba.baichuan.trade.common.AlibcTradeCommon.init(Unknown Source)
at com.alibaba.baichuan.trade.biz.AlibcTradeBiz.init(Unknown Source)
at com.alibaba.baichuan.android.trade.AlibcTradeSDK.b(Unknown Source)
at com.alibaba.baichuan.android.trade.AlibcTradeSDK.a(Unknown Source)
at com.alibaba.baichuan.android.trade.e.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
按官方文档,什么都是配置好的,之前也初始化成功,最近直接安装到手机上时候,却是初始化失败,看log,错误码是203,意思是找不到安全图片,但是正式打包的没问题呀,关闭AS、重启电脑折腾了许久,还是不行。。。
后来才发现重新安装了AS,如下地方没设置好导致,泪泪泪。。。自己坑自己呀
1、把 Android Studio 的 Instant Run 给关掉,File → Settings → Build,Execution,Deployment → Instant Run 如图: