錯誤發生在正在運行的應用中的設備:UnsatisfiedLinkError(com.esri.core.runtime.LicenseImpl.nativeIsClientIdValid)
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.a(Unknown Source)
at com.esri.android.a.b.b(Unknown Source)
相關代碼:
import com.esri.android.runtime.ArcGISRuntime;
public class MainActivity extends FragmentActivity implements NavigationDrawerFragment.NavigationDrawerCallbacks {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ArcGISRuntime.setClientId("xxxxxxxxxxxxxxxx");
......
的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "xxx.xxxx.xxxxx"
minSdkVersion 17
targetSdkVersion 19
versionCode 1
versionName "1.0"
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = new File(output.outputFile.parent, "xxxx-release.apk")
}
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
}
proguard-rules.txt:
-keep class android.view.** { *; }
-keep class com.esri.** { *; }
-keep class javax.servlet.** { *; }
-keep class jcifs.http.** { *; }
-keep class org.apache.http.** { *; }
-keep class org.joda.time.** { *; }
-keep class org.w3c.dom.bootstrap.** { *; }
-keep class org.xmlpull.v1.** { *; }
-dontwarn javax.servlet.**
-dontwarn jcifs.http.**
-dontwarn org.apache.http.**
-dontwarn org.joda.time.**
-dontwarn org.w3c.dom.bootstrap.**
-dontwarn org.xmlpull.v1.**
的logcat:
03-04 18:06:19.213 13255-13255/xxx.xxxx.xxxxx D/dalvikvm﹕ GC_FOR_ALLOC freed 360K, 17% free 35228K/42136K, paused 17ms, total 17ms
03-04 18:06:19.283 13255-13255/xxx.xxxx.xxxxx D/dalvikvm﹕ GC_FOR_ALLOC freed 368K, 16% free 35516K/42136K, paused 14ms, total 14ms
03-04 18:06:19.343 13255-13753/xxx.xxxx.xxxxx D/dalvikvm﹕ GC_FOR_ALLOC freed 408K, 15% free 35859K/42136K, paused 14ms, total 14ms
03-04 18:06:19.353 13255-13753/xxx.xxxx.xxxxx W/dalvikvm﹕ Failed processing annotation value
03-04 18:06:19.353 13255-13753/xxx.xxxx.xxxxx W/dalvikvm﹕ Exception Ljava/lang/NoSuchFieldError; thrown while initializing Lorg/b/a/d/e/z;
03-04 18:06:19.353 13255-13753/xxx.xxxx.xxxxx W/dalvikvm﹕ Exception Ljava/lang/NoSuchFieldError; thrown while initializing Lorg/b/a/d/an;
03-04 18:06:19.353 13255-13753/xxx.xxxx.xxxxx W/dalvikvm﹕ Exception Ljava/lang/NoSuchFieldError; thrown while initializing Lcom/esri/core/internal/util/d;
03-04 18:06:19.353 13255-13754/xxx.xxxx.xxxxx I/dalvikvm﹕ Rejecting re-init on previously-failed class Lcom/esri/core/internal/util/d; v=0x0
03-04 18:06:19.423 13255-13255/xxx.xxxx.xxxxx D/dalvikvm﹕ GC_FOR_ALLOC freed 776K, 15% free 35950K/42136K, paused 14ms, total 14ms
03-04 18:06:19.443 13255-13756/xxx.xxxx.xxxxx I/dalvikvm﹕ Rejecting re-init on previously-failed class Lcom/esri/core/internal/util/d; v=0x0
03-04 18:06:19.453 13255-13755/xxx.xxxx.xxxxx I/dalvikvm﹕ Rejecting re-init on previously-failed class Lcom/esri/core/internal/util/d; v=0x0
我使用:Android的工作室1.0.2和ArcGIS SDK 9.2.5
有,如果應用程序是由Android Studio中運行沒有問題。如果應用程序在APK中生成,安裝在設備中,然後運行,則會發生錯誤。
有沒有解決方法?
非常感謝!
Similar question答案不起作用。
請發佈您的代碼(包括本地代碼) – 2015-02-27 11:08:18
我得到了同樣的錯誤當我使用SONIC-NDK。此錯誤發生時,如此丟失文件.. – user 2015-03-01 16:59:17
相關代碼包括在內。 – kel 2015-03-02 06:03:09