2016-02-17 51 views
2

我構建了一個基於VLC的播放器,並且當我想爲Android 6.0構建一個版本時,播放器無法在Android 6.0設備上啓動。以下是日誌:Can not加載vlcjni庫:java.lang.UnsatisfiedLinkError:dlopen失敗:/data/app/lib/arm/libvlcjni.so:有文本重定位。 我已經嘗試了很多方法來解決它,但我還沒有解決它。 我希望任何人都可以告訴我這個問題。無法在Android 6.0上加載vlcjni庫

回答

0

這裏是類似的問題和答案: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

+0

是啊,我知道這種方式,它可以解決這個問題。但是這不是你知道,我們發佈了使用「23」作爲targetSDKVersion我們的APP最好way.As,我們不能將其更改爲「22」來解決這個問題。或者我們不能在GooglePlay上發佈我們的APP。 – iQiQi

0

我只需要創建我的Android庫中的libs文件夾,然後從jniLibs文件夾移到庫文件到libs文件夾。我相信這可能與更新版本的Gradle和構建工具有關。這樣,你不必降級你的構建工具/ Gradle。

UPDATE:

我是能夠建立與VLC-機器人下面的build.gradle腳本。我需要以下更新版本。這使我可以使用SDK版本24構建,包含構建工具24和gradle版本2.2.0。看看這是否適合你。

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' 
}