ijkplayer移植到Flutter遇到的问题

04-22 15:59:52.967 9722-9722/com.example.ijkplayer_example E/flutter:[ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(40)]java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.ijkplayer_example-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.ijkplayer_example-2/lib/arm64,/data/app/com.example.ijkplayer_example-2/base.apk!/lib/arm64-v8a,/vendor/lib64,/system/lib64]]]couldn't find "libijkffmpeg.so"

修改下面加黑部分

defaultConfig {

    //TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).

    applicationId "com.example.ijkplayer_example"

    minSdkVersion 16

    targetSdkVersion 28

    versionCode flutterVersionCode.toInteger()

    versionName flutterVersionName

    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    ndk {

        abiFilters "armeabi-v7a"

    }

}

2.    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.ijkplayer_example-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.ijkplayer_example-1/lib/arm,/data/app/com.example.ijkplayer_example-1/base.apk!/lib/armeabi-v7a,/vendor/lib,/system/lib]]]couldn't find "libflutter.so"

参考了帖子修改了下面的部分,但是还是无效

https://www.jianshu.com/p/04684df6d829

https://www.jianshu.com/p/91f1b82957a4

buildTypes {

    release {

        ndk { abiFilters "armeabi-v7a" }

    }

    debug {

        ndk { abiFilters "armeabi-v7a" }

    }

}


解决办法 在调试的时候 使用命令启动 flutter run --target-platform=android-arm ,路径在 audiocore-flutter/example  目录下执行

在正常release  flutter 引用是没有问题的。

你可能感兴趣的:(ijkplayer移植到Flutter遇到的问题)