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 引用是没有问题的。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容