3

I build a player based VLC,and when I want to build a verson for Android 6.0,player can't start on Android 6.0 device.Here are the log:Can't load vlcjni library:java.lang.UnsatisfiedLinkError:dlopen failed:/data/app/lib/arm/libvlcjni.so: has text relocations. And I have tried so many ways to solve it,but I haven't solve it yet. I hope anyone can tell me about the problem.

iQiQi
  • 31
  • 2
  • 6

2 Answers2

0

Here is similar question and answers: libavcodec.so: has text relocations

Today, I got the same error messages when testing my app with Android 6.0 on a Nexus 6 (Motorola). I solved my issue by checking the targetSDKVersion in the manifest file. Using "22" and not "23" as targetSDKVersion solved it. (See below)

<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="22" />

I also checked the build.gradle files for compile version and targetSDKversion:

compileSdkVersion 22 buildToolsVersion '22.0.1'

defaultConfig { minSdkVersion 15 targetSdkVersion 22 }

Hope this will help you. However, this is just a short term workaround for now, I hope that we will get some feedback from metaio though.

Regards, christin

Community
  • 1
  • 1
molokoka
  • 1,290
  • 12
  • 16
  • Yeah,I know this way,and it can solve this problem.But it's not the best way.As you know,we published our APP using "23" as targetSDKVersion,and we can't change it to "22" to solve this problem.Or we can't publish our APP on GooglePlay. – iQiQi Aug 10 '16 at 06:52
0

I only had to create a libs folder in my Android library, and then move the library files from the jniLibs folder to the libs folder. I believe this may have to do with the newer version of Gradle and build tools. That way, you don't have to downgrade your build tools/Gradle.

UPDATE:

I was able to build with the following build.gradle script for vlc-android. I needed the following updated versions. This allows me to build with SDK version 24, with build tools 24, and gradle version 2.2.0. See if this works for you.

buildscript {
    repositories {
        mavenCentral()
    jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'org.ajoberstar:gradle-git:1.3.2'
    }
}
apply plugin: 'com.android.library'
android {
    compileSdkVersion 24
    buildToolsVersion '25.0.0'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    //noinspection GradleCompatible
    compile "com.android.support:support-v4:25.2.0"
    compile 'com.android.support:support-annotations:25.2.0'
}
SaundersB
  • 607
  • 2
  • 12
  • 25