我构建了一个基于播放器的VLC,并且当我想为Android 6.0构建版本时,播放器无法在Android 6.0设备上启动.这是日志:无法加载vlcjni库:java.lang .UnsatisfiedLinkError:dlopen失败:/data/app/lib/arm/libvlcjni.so:具有文本重定位. 我已经尝试了很多方法来解决它,但是我还没有解决. 我希望有人能告诉我这个问题.
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.
推荐答案我只需要在Android库中创建一个libs文件夹,然后将库文件从jniLibs文件夹移至libs文件夹.我相信这可能与较新版本的Gradle和构建工具有关.这样,您不必降级您的构建工具/Gradle.
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.
更新:
我能够使用以下适用于vlc-android的build.gradle脚本进行构建.我需要以下更新版本.这使我可以使用SDK版本24,构建工具24和gradle 2.2.0进行构建.看看这是否适合您.
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' }更多推荐
无法在Android 6.0上加载vlcjni库
发布评论