无法在Android 6.0上加载vlcjni库 [英] Can't load vlcjni library on Android 6.0

查看:213
本文介绍了无法在Android 6.0上加载vlcjni库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建了一个基于播放器的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库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆