arcgis for android项目从eclipse移植到android studio运行时发生的错误

   最近把android项目从eclipse移植到android studio中,编译是没有问题的,但是在机器上运行时直接闪退,查找一下日志,发现如下的log:

   java.lang.UnsatisfiedLinkError: Native method not found: com.esri.core.runtime.LicenseImpl.nativeIsClientIdValid:(Ljava/lang/String;)Z
    at com.esri.core.runtime.LicenseImpl.nativeIsClientIdValid(Native Method)
    at com.esri.core.runtime.LicenseImpl.b(SourceFile:103)
    at com.esri.android.runtime.ArcGISRuntime$License.b(SourceFile:133)
    at com.esri.android.runtime.ArcGISRuntime$License.a(SourceFile:72)
    at com.esri.android.runtime.ArcGISRuntime.setClientId(SourceFile:51)
    at com.xxx.android.xxxx.activity.MainActivity.onCreate(MainActivity.java:73)
    at android.app.Activity.performCreate(Activity.java:5458)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
    at android.app.ActivityThread.access$900(ActivityThread.java:175)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:146)
    at android.app.ActivityThread.main(ActivityThread.java:5603)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
    at dalvik.system.NativeStart.main(Native Method)

在代码中错误出现在ArcGISRuntime.setClientId(string)之时。但是在eclipse里面确是没有问题的。arcgis for android sdk版本用的是10.2.4和10.2.7,都试过都是出现这个问题。找了很久没找到解决方案,看到stackflow上说是因为代码混淆时的问题,但是我根本没有对代码进行混淆。异常奇怪.....

继续查找是什么原因,如果有碰到相同的问题的朋友,可以留下解决方案.....

posted @ 2015-12-25 14:49  mengxin  阅读(375)  评论(0编辑  收藏  举报