Jpush [failed to get sdk version!], Jpushsdk
The error log is as follows:
5-31 12:47:40. 088 23896-23896 /? E/JIGUANG-JCore: [JCoreGlobal] Get sdk version fail! [Failed to get sdk version!]
05-31 12:47:40. 088 23896-23896 /? W/System. err: java. lang. UnsatisfiedLinkError: Native method not found: cn. jiguang. service. Protocol. GetSdkVersion :() I
05-31 12:47:40. 088 23896-23896 /? W/System. err: at cn. jiguang. service. Protocol. GetSdkVersion (Native Method)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at cn. jiguang. B. a. a (Unknown Source)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at cn. jiguang. B. a. a (Unknown Source)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at cn. jiguang. api. JCoreInterface. init (Unknown Source)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at cn. jpush. android. a. a (SourceFile)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at cn. jpush. android. api. JPushInterface. init (SourceFile)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at com. baidu. jiangweiqiang. jpush. PushApplication. onCreate (PushApplication. java: 17)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at com. android. tool. fd. runtime. BootstrapApplication. onCreate (BootstrapApplication. java: 370)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at android. app. Instrumentation. callApplicationOnCreate (Instrumentation. java: 999)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at android. app. ActivityThread. handleBindApplication (ActivityThread. java: 4151)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at android. app. ActivityThread. access $1300 (ActivityThread. java: 130)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at android. app. ActivityThread $ H. handleMessage (ActivityThread. java: 1255)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at android. OS. Handler. dispatchMessage (Handler. java: 99)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at android. OS. low.loop (low.java: 137)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at android. app. ActivityThread. main (ActivityThread. java: 4745)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at java. lang. reflect. Method. invokeNative (Native Method)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at java. lang. reflect. Method. invoke (Method. java: 511)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at com. android. internal. OS. ZygoteInit $ MethodAndArgsCaller. run (ZygoteInit. java: 786)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at com. android. internal. OS. ZygoteInit. main (ZygoteInit. java: 553)
05-31 12:47:40. 088 23896-23896 /? W/System. err: at dalvik. system. NativeStart. main (Native Method)
Error analysis:
This error occurs because the libjpush. so file is not correctly loaded. Check whether libjpush. so is in the correct position (libs-> armeabi-> libjpush. so)
Solution:
To migrate the JPush SDK to Android Studio, you need to add the. SO file and package it into the lib folder of the APK. You can edit the build. gradle script and customize the *. so directory.
Demo reference:
android { // .. android settings .. sourceSets.main { jniLibs.srcDirs = ['libs'] // <-- Set your folder here! } }