运行demo失败,编译通过:[JCoreGlobal] Get sdk version fail![获取sdk版本失败!]

sdk
error
标签: #<Tag:0x00007fb83d0dd408> #<Tag:0x00007fb83d0dd200>

(向上一区) #1

这个里面说的问题没有解决。Android SDK 报错:Get sdk version fail - 获取sdk版本失败

目录结构如下:都引用了,AS2.2 上,
版本也修改成和demo一样的:
compileSdkVersion 21
minSdkVersion 9
targetSdkVersion 21

12/16 18:27:11: Launching app
No apk changes detected since last installation, skipping installation of D:\DevWorkSpace\jpushdemo\app\build\outputs\apk\app-debug.apk
$ adb shell am force-stop com.XXXX.XXXX
$ adb shell am start -n "com.XXXX.XXXX/com.example.jpushdemo.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 4263 on device emulator-5554
I/InstantRun: Instant Run Runtime started. Android package is com.XXXX.XXXX, real application class is com.example.jpushdemo.ExampleApplication.
W/InstantRun: No instant run dex files added to classpath
D/JPush: [ExampleApplication] onCreate
D/JIGUANG-JPush: [JPushInterface] action:init - sdkVersion:3.0.0, buildId:316
D/JIGUANG-JPush: [AndroidUtil] action:checkValidManifest
D/JIGUANG-JCore: [AndroidUtil] action:checkValidManifest
D/JIGUANG-JCore: [JCoreGlobal] action:init - sdkVersion:1.0.0, buildId:110
W/System.err: java.lang.UnsatisfiedLinkError: Couldn't load jcore100 from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.XXXX.XXXX-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.XXXX.XXXX-1, /system/lib]]]: findLibrary returned null
W/System.err:     at java.lang.Runtime.loadLibrary(Runtime.java:358)
W/System.err:     at java.lang.System.loadLibrary(System.java:526)
W/System.err:     at cn.jiguang.service.Protocol.<clinit>(Unknown Source)
W/System.err:     at cn.jiguang.c.a.a(Unknown Source)
W/System.err:     at cn.jiguang.c.a.a(Unknown Source)
W/System.err:     at cn.jiguang.api.JCoreInterface.init(Unknown Source)
W/System.err:     at cn.jpush.android.d.a(Unknown Source)
W/System.err:     at cn.jpush.android.api.JPushInterface.init(Unknown Source)
W/System.err:     at com.example.jpushdemo.ExampleApplication.onCreate(ExampleApplication.java:21)
W/System.err:     at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:370)
W/System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
W/System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
W/System.err:     at android.app.ActivityThread.access$1500(ActivityThread.java:135)
W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err:     at android.os.Looper.loop(Looper.java:136)
W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5017)
W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err:     at java.lang.reflect.Method.invoke(Method.java:515)
W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
W/System.err:     at dalvik.system.NativeStart.main(Native Method)
W/dalvikvm: No implementation found for native Lcn/jiguang/service/Protocol;.GetSdkVersion:()I
E/JIGUANG-JCore: [JCoreGlobal] Get sdk version fail![获取sdk版本失败!]
W/System.err: java.lang.UnsatisfiedLinkError: Native method not found: cn.jiguang.service.Protocol.GetSdkVersion:()I
W/System.err:     at cn.jiguang.service.Protocol.GetSdkVersion(Native Method)
W/System.err:     at cn.jiguang.c.a.a(Unknown Source)
W/System.err:     at cn.jiguang.c.a.a(Unknown Source)
W/System.err:     at cn.jiguang.api.JCoreInterface.init(Unknown Source)
W/System.err:     at cn.jpush.android.d.a(Unknown Source)
W/System.err:     at cn.jpush.android.api.JPushInterface.init(Unknown Source)
W/System.err:     at com.example.jpushdemo.ExampleApplication.onCreate(ExampleApplication.java:21)
W/System.err:     at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:370)
W/System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
W/System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
W/System.err:     at android.app.ActivityThread.access$1500(ActivityThread.java:135)
W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err:     at android.os.Looper.loop(Looper.java:136)
W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5017)
W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err:     at java.lang.reflect.Method.invoke(Method.java:515)
W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
W/System.err:     at dalvik.system.NativeStart.main(Native Method)
E/JIGUANG-JCore: [JCoreGlobal] JCore .so file do not match JCore .jar file in the project, Failed to init JCore
W/JIGUANG-JCore: [JCoreInterface] JCore init failed
D/dalvikvm: GC_FOR_ALLOC freed 280K, 10% free 3224K/3576K, paused 3ms, total 3ms
D/JIGUANG-JCore: [AndroidUtil] action:checkValidManifest
D/JIGUANG-JCore: [JCoreGlobal] action:init - sdkVersion:1.0.0, buildId:110
W/dalvikvm: No implementation found for native Lcn/jiguang/service/Protocol;.GetSdkVersion:()I
E/JIGUANG-JCore: [JCoreGlobal] Get sdk version fail![获取sdk版本失败!]
W/System.err: java.lang.UnsatisfiedLinkError: Native method not found: cn.jiguang.service.Protocol.GetSdkVersion:()I
W/System.err:     at cn.jiguang.service.Protocol.GetSdkVersion(Native Method)
W/System.err:     at cn.jiguang.c.a.a(Unknown Source)
W/System.err:     at cn.jiguang.c.a.a(Unknown Source)
W/System.err:     at cn.jiguang.api.JCoreInterface.getDeviceId(Unknown Source)
W/System.err:     at cn.jpush.android.api.JPushInterface.getUdid(Unknown Source)
W/System.err:     at com.example.jpushdemo.ExampleUtil.getDeviceId(ExampleUtil.java:106)
W/System.err:     at com.example.jpushdemo.MainActivity.initView(MainActivity.java:58)
W/System.err:     at com.example.jpushdemo.MainActivity.onCreate(MainActivity.java:37)
W/System.err:     at android.app.Activity.performCreate(Activity.java:5231)
W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
W/System.err:     at android.app.ActivityThread.access$800(ActivityThread.java:135)
W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err:     at android.os.Looper.loop(Looper.java:136)
W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5017)
W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err:     at java.lang.reflect.Method.invoke(Method.java:515)
W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
W/System.err:     at dalvik.system.NativeStart.main(Native Method)
E/JIGUANG-JCore: [JCoreGlobal] JCore .so file do not match JCore .jar file in the project, Failed to init JCore

                 [ 12-14 08:31:16.803  4263: 4263 D/         ]
                 HostConnection::get() New Host Connection established 0xb8adf600, tid 4263
D/OpenGLRenderer: Enabling debug mode 0

(向上一区) #2

是不是编译成apk后,so的cpu文件没有进来,所以找不到。我尝试把所有so文件删除,结果报的异常时一样的。


(向上一区) #3

但是这个怎么解释:
W/dalvikvm: No implementation found for native Lcn/jiguang/service/Protocol;.GetSdkVersion:()I
本地native类里应该是没有这个方法,或者so就没有加载进来吗?


#4

排查办法:


(向上一区) #5

解决了,

AS的IDE中:cpu的so文件要放到\jpushdemo\app\src\main\jniLibs下,
eclipse上是按照官方的放置。


(向上一区) #6

官方文档应该说明下,不同的ide一些文件放的位置。


#7

这里有提到,可能不怎么惹人注意- -


(向上一区) #8

对,太谢谢了,看到了,但是直接就或略过了,自己还是不够理解仔细。


#9

:grin:没事,遇到问题可以先搜一搜,不少开发者遇到过跟你一样的问题


(yusen) #10

可以详细点不??


(yusen) #11

我的还是报错


#12

排查方案链接和该贴的讨论讲的很清楚了,请仔细的一一做排查。