java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader

前端 未结 17 1785
耶瑟儿~
耶瑟儿~ 2020-11-29 22:21

Is there someone who had experience with this error?

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file \"/data/app/org.swig         


        
相关标签:
17条回答
  • 2020-11-29 22:51

    If you use module with c++ code and have the same issue you could try

    Build -> Refresh Linked C++ Projects

    Also, you should open some file from this module and do

    Build -> Make module "YourNativeLibModuleName"

    0 讨论(0)
  • 2020-11-29 22:51

    Ensure you have included the different abiFilters, this enables Gradle know what ABI libraries to package into your apk.

    defaultConfig {
     ndk { 
           abiFilters "armeabi-v7a", "x86", "armeabi", "mips" 
         } 
      }
    

    If you storing your jni libs in a different directory, or also using externally linked jni libs, Include them on the different source sets of the app.

    sourceSets { 
      main { 
        jni.srcDirs = ['src/main/jniLibs'] 
        jniLibs.srcDir 'src/main/jniLibs' 
        } 
    }
    
    0 讨论(0)
  • 2020-11-29 22:55

    This is worked for me

    If your having .so file in armeabi then mention inside ndk that folder alone.

    defaultConfig {
            applicationId "com.xxx.yyy"
            minSdkVersion 17
            targetSdkVersion 26
            versionCode 1
            versionName "1.0"
            renderscriptTargetApi 26
            renderscriptSupportModeEnabled true
            ndk {
                abiFilters "armeabi"
            }
        }
    

    and then use this

    android.useDeprecatedNdk=true;
    

    in gradle.properties file

    0 讨论(0)
  • 2020-11-29 22:56

    I use Android Studio 3.0 and encounter this problem. And I'm sure app's build.gradle is OK.

    Go to Run -> Edit Configurations -> Profiling, and disable "Enable advanced profiling".

    This works for me. Reference answer

    0 讨论(0)
  • 2020-11-29 22:57

    What worked for me was to place the jniLibs folder under the "main" folder, just besides the "java" and "res" folders, for example project -> app -> src -> main -> jniLibs

    I had all the libraries with the correct names and each one placed on their respective architecture subfolder, but I still had the same exception; even tried a lot of other SO answers like the accepted answer here, compiling a JAR with the .so libs, other placing of the jniLibs folder, etc.

    For this project, I had to use Gradle 2.2 and Android Plugin 1.1.0 on Android Studio 1.5.1

    0 讨论(0)
提交回复
热议问题