【问题标题】:Unsatisfiedlinkerror with Android 5.0.1 updateAndroid 5.0.1 更新时出现 Unsatisfiedlinkerror
【发布时间】:2015-04-04 15:09:38
【问题描述】:

我在 HTC One M8 上使用 Android Studio 并调试应用程序。我昨晚将手机更新到了 Android 5.0.1。

编辑:最近购买了 Nexus 9,同样的问题正在发生。

我第一次尝试运行应用程序时,gradle 构建没有问题,但我现在遇到运行时错误。

我已经研究过这个问题,其他人似乎遇到了与图书馆位置相关的不满意链接错误。但是,我没有对库或代码进行任何更改。

Android Studio 也会经常无法部署调试 APK,提示“未检测到 APK 更改。 Activity 未启动,尽管 APK 发生了明显变化,但其当前任务已被置于最前面。

为什么会出现此错误?感谢您的宝贵时间。

compileSdkVersion 21 构建工具版本“21.1.2” minSdkVersion 15 targetSdkVersion 21

Gradle 文件如下。

02-05 10:56:30.330    6516-6524/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
02-05 10:56:30.410    6516-6527/? E/art﹕ No implementation found for java.lang.String android.os.SystemProperties.native_get(java.lang.String) (tried Java_android_os_SystemProperties_native_1get and Java_android_os_SystemProperties_native_1get__Ljava_lang_String_2)
02-05 10:56:30.490    6516-6516/? A/art﹕ art/runtime/thread.cc:1116] No pending exception expected: java.lang.UnsatisfiedLinkError: com.htc.customization.HtcCustomizationManager
02-05 10:56:30.490    6516-6516/? A/art﹕ art/runtime/thread.cc:1116]   at boolean android.database.sqlite.SQLiteConnection.supportServo() (SQLiteConnection.java:1851)
02-05 10:56:30.490    6516-6516/? A/art﹕ art/runtime/thread.cc:1116]   at void android.database.sqlite.SQLiteConnection.<clinit>() (SQLiteConnection.java:1541)
02-05 10:56:30.490    6516-6516/? A/art﹕ art/runtime/thread.cc:1116]
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284] Runtime aborting...
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284] Aborting thread:
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284] "main" prio=5 tid=1 Runnable
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   | group="" sCount=0 dsCount=0 obj=0x75e28080 self=0xb7a902a0
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   | sysTid=6516 nice=0 cgrp=apps/bg_non_interactive sched=0/0 handle=0xb6f24058
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   | state=R schedstat=( 0 0 0 ) utm=16 stm=6 core=3 HZ=100
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   | stack=0xbe4ad000-0xbe4af000 stackSize=8MB
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   | held mutexes= "abort lock" "mutator lock"(shared held)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #00 pc 00004828  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #01 pc 00002ec5  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #02 pc 0024441d  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #03 pc 002277eb  /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+394)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #04 pc 0021a58f  /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, art::Thread*)+22)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #05 pc 0021a7cd  /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+324)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #06 pc 0021a9c1  /system/lib/libart.so (art::Runtime::Abort()+72)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #07 pc 000a5dbf  /system/lib/libart.so (art::LogMessage::~LogMessage()+1322)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #08 pc 0022821f  /system/lib/libart.so (art::Thread::AssertNoPendingException() const+374)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #09 pc 000d10b7  /system/lib/libart.so (art::ClassLinker::FindClass(art::Thread*, char const*, art::Handle<art::mirror::ClassLoader>)+30)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #10 pc 001cf97f  /system/lib/libart.so (art::JNI::FindClass(_JNIEnv*, char const*)+798)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #11 pc 0005d02b  /system/lib/libandroid_runtime.so (???)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #12 pc 00073f87  /system/lib/libandroid_runtime.so (android::register_android_database_SQLiteConnection(_JNIEnv*)+278)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #13 pc 0005cf29  /system/lib/libandroid_runtime.so (???)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #14 pc 0005e131  /system/lib/libandroid_runtime.so (android::AndroidRuntime::startReg(_JNIEnv*)+28)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #15 pc 0005e289  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&)+304)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #16 pc 00001691  /system/bin/app_process32 (???)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #17 pc 0000f31d  /system/lib/libc.so (__libc_init+44)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #18 pc 000017ac  /system/bin/app_process32 (???)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   (no managed stack frames)
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284] Pending exception java.lang.UnsatisfiedLinkError thrown by 'unknown throw location'
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284] java.lang.UnsatisfiedLinkError: com.htc.customization.HtcCustomizationManager
02-05 10:56:30.570    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   at boolean android.database.sqlite.SQLiteConnection.supportServo() (SQLiteConnection.java:1851)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   at void android.database.sqlite.SQLiteConnection.<clinit>() (SQLiteConnection.java:1541)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284] Dumping all threads without appropriate locks held: thread list lock
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284] All threads:
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284] DALVIK THREADS (11):
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284] "main" prio=5 tid=1 Runnable
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   | group="" sCount=0 dsCount=0 obj=0x75e28080 self=0xb7a902a0
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   | sysTid=6516 nice=0 cgrp=apps/bg_non_interactive sched=0/0 handle=0xb6f24058
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   | state=R schedstat=( 0 0 0 ) utm=17 stm=6 core=3 HZ=100
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   | stack=0xbe4ad000-0xbe4af000 stackSize=8MB
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   | held mutexes= "abort lock" "mutator lock"(shared held)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #00 pc 00004828  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #01 pc 00002ec5  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #02 pc 0024441d  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #03 pc 002277eb  /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+394)

...以及更多类似的行...然后...

02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   native: #05 pc 000003d3  /data/dalvik-cache/arm/system@framework@boot.oat (Java_java_lang_Object_wait__+82)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   at java.lang.Object.wait!(Native method)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   - waiting on <0x25853498> (a java.lang.Daemons$GCDaemon)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   at java.lang.Daemons$GCDaemon.run(Daemons.java:396)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   - locked <0x25853498> (a java.lang.Daemons$GCDaemon)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]   at java.lang.Thread.run(Thread.java:818)
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]
02-05 10:56:30.580    6516-6516/? A/art﹕ art/runtime/runtime.cc:284]
02-05 10:56:30.580    6516-6516/? A/libc﹕ Fatal signal 6 (SIGABRT), code -6 in tid 6516 (main)
02-05 10:56:30.690      478-478/? E/DEBUG﹕ AM write failure (32 / Broken pipe)
02-05 10:56:31.050    1009-6279/? E/SharedPreferencesImpl﹕ Couldn't create directory for SharedPreferences file shared_prefs/log_files.xml

这是我的 gradle 文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.xxx.xxx"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 14
        versionName "0.2.9.1"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-xxx-rules.txt'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}

repositories {
    maven {
        url "https://repo.commonsware.com.s3.amazonaws.com"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services:6.5.87'
    compile 'joda-time:joda-time:2.7'
    compile 'au.com.bytecode:opencsv:2.4'
    compile 'uk.co.chrisjenx:calligraphy:2.0.1'
    compile 'com.commonsware.cwac:wakeful:1.0.+'
}

【问题讨论】:

  • 你有什么证据表明这个堆栈跟踪来自你的应用程序?
  • build.gradle 哪个 sdktool 版本?哪个构建工具版本?
  • @CommonsWare 我不知道。它来自 Android Studio 中的“运行”选项卡,我想这与 ADB 有关。我已经更新了跟踪以反映 DEVICE SHELL COMMAND。谢谢。
  • 我遇到了同样的问题。大多数情况下,如果我在构建之前进行清理,下次我尝试运行时,它会安装,但这并不是每次都有效。这伤害了爸爸。
  • 关闭 Android Studio 并通过 adb 安装允许我在此问题后最终安装。我在这里有 2 台设备 atm,只有一台在抱怨 Unsatisfiedlinkerror

标签: java android android-studio


【解决方案1】:

我会推荐以下结构

|---lib/
    |---armeabi/
         /Your.so file/
    |---armeabi-v7a
       /Your.so file (same file copy here)/

如果你的文件结构如上,

请尝试将以下代码添加到您的 gradle 文件中

sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }

        buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

我在 Lollipop 中使用生物识别传感器 API 时遇到了同样的问题,搜索了很多最后我得到了 armeabi-v7a 文件夹作为我的解决方案。

如果以上没有解决您的问题,那么, 此问题与该设备的Android OS有关,不知何故无法调用本机库, GitHub instead of solving moved to next

Google group give some alternative solutions

【讨论】:

  • 原谅我的无知,但是这个结构在哪里呢?您引用的是哪个 .so 文件?搜索我的环境没有发现 armeabi 文件夹,只有几个 armeabi-v7a 文件夹。
  • 你的项目中有any.so fie吗?如果是,那么我对这个 .so 文件的回答。如果您的项目中没有 .so 文件,那么您的 armeabi-v7a 文件夹中有什么文件?请提及
  • 具体来说,我的项目中没有 armeabi-v7a 文件夹。仅限 SDK 中的标准目录。
  • 能否请您发布您的 gradle 文件和文件夹结构?
  • 这个错误太烦人了。我在华为 Ascend P7 上有 android 5.1.1,它也在这里。 Lolipop 是有史以来最糟糕的安卓更新:D
【解决方案2】:

正如所有日志所示,这是一个 HTC Sense 错误。 Android Studio 部署新调试 APK 的方式似乎会触发此错误。 This post 建议使用备用启动器可以缓解此问题。

【讨论】:

  • 感谢您的建议。我尝试过备用发射器,但行为没有变化。 Android Studio 将毫无问题地安装调试 APK,但启动它是另一回事。话虽如此,我最近开始直接从手机屏幕启动它。但是,我将在原始问题中添加另一个相关问题,这会使该错误更加烦人。
猜你喜欢
  • 2012-04-10
  • 1970-01-01
  • 2022-12-05
  • 1970-01-01
  • 1970-01-01
  • 2023-02-15
  • 2017-06-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多