QtAV icon indicating copy to clipboard operation
QtAV copied to clipboard

Using QtAV on Android x86 crash at start

Open julienchevet opened this issue 4 years ago • 3 comments

QtAV, Qt version and platform

  • QtAV commit ec258a2
  • Qt 5.15.0
  • Platform Android x86
  • Android SDK 28
  • Android NDK 21.3.6528147

Reproduction steps

  1. Build QtAV for android
  2. Use QtAV in a Qt project with FFMPEG 4.1 libs linked in ANDROID_EXTRA_LIBS
  3. Compile it for android x86
  4. The App compile but crash at start

Expected behavior

App running successfully and playing RTSP stream

Actual behavior

App crash at start with dlopen failed error for libswresample.so

Log file

I project.exampl: Not late-enabling -Xcheck:jni (already on)
W project.exampl: Unexpected CPU variant for X86 using defaults: x86
W System  : ClassLoader referenced unknown path:
D OpenGLRenderer: Skia GL Pipeline
I QtCore  : Start
E linker  : "/data/app/org.qtproject.example-fS0dWAUrJsvYh6LNVhr7HQ==/lib/x86/libswresample.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
E AndroidRuntime: Process: org.qtproject.example, PID: 10224
E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/org.qtproject.example-fS0dWAUrJsvYh6LNVhr7HQ==/lib/x86/libswresample.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
E AndroidRuntime: 	at java.lang.Runtime.load0(Runtime.java:928)
E AndroidRuntime: 	at java.lang.System.load(System.java:1633)
E AndroidRuntime: 	at org.qtproject.qt5.android.QtNative$2.run(QtNative.java:308)
E AndroidRuntime: 	at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87)
E AndroidRuntime: 	at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:764)
I Process : Sending signal. PID: 10224 SIG: 9

julienchevet avatar Jul 08 '20 12:07 julienchevet

did you try new ffmpeg packages in https://sourceforge.net/projects/avbuild/files/android/ ? master and 4.3 has no textrel, and should work for you.

wang-bin avatar Jul 21 '20 01:07 wang-bin

It doesn't work with FFmpeg 4.3

julienchevet avatar Sep 07 '20 13:09 julienchevet

With FFmpeg 4.3 I have got this error:

E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: invalid ELF file "/data/app/com.myapp-rb7Psob8RiU4X8aXiqQuKw==/lib/x86/libswscale.so" load segment[4]: p_offset (0xc1000) + p_filesz (0x0) ( = 0xc1000) past end of file (0xc04a4)

julienchevet avatar Sep 08 '20 10:09 julienchevet