4

I've compile the android source source ./build/envsetup.sh lunch aosp_x86_64-eng

when I run emulator64-x86 in terminal, error occur:

emulator64-x86: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.7' not found (required by emulator64-x86)

emulator64-x86: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by emulator64-x86)

emulator64-x86: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: version `Qt_5' not found (required by emulator64-x86)

emulator64-x86: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by emulator64-x86)

I've found qt in

/home/wanyu/work/aosp/prebuilts/android-emulator/linux-x86_64/lib64/qt/

this directory include libQt5Core.so.5.7, libQt5Widgets.so.5.7 etc.

but libQt5Core.so in

/usr/lib/x86_64-linux-gnu/

version is 5.5

I've tried to set LD_LIBRARY_PATH to:

/home/wanyu/work/aosp/prebuilts/android-emulator/linux-x86_64/lib64/

but the error still occur.

Copying the libQt5Core.so.5 to

/usr/lib/x86_64-linux-gnu/

will solve this error, but qt platform plugin libqxcb won't work.

How I can change the lib path to the

/home/wanyu/work/aosp/prebuilts/android-emulator/linux-x86_64/lib64

when I run emulator64-x86?

keai4le
  • 623
  • 2
  • 7
  • 13

3 Answers3

6

Leave libQt5Core.so.5 in /home/wanyu/work/aosp/prebuilts/android-emulator/linux-x86_64/lib64/qt/. Qt does not like to be moved around, it makes it lose where the plugins are stored. In your case it might end up trying to load Qt 5.5 plugins.

Set LD_LIBRARY_PATH to /home/wanyu/work/aosp/prebuilts/android-emulator/linux-x86_64/lib64/qt/.

Use ldd to check which library will be used when running.

Also note that qxcb requires X11 to run.

Benjamin T
  • 8,120
  • 20
  • 37
  • 3
    finally I use: export LD_LIBRARY_PATH=/home/wanyu/work/aosp/prebuilts/android-emulator/linux-x86_64/lib64/qt/lib/ . resolve this issue. – keai4le Feb 17 '17 at 18:21
  • 1
    For me the correct path is `android-sdk/lib64/qt/lib/`. Also, `ANDROID_SDK_ROOT` must be defined (it's equal to `ANDROID_HOME`). – Eric Burel Sep 24 '18 at 14:04
0

For me what works was copying all android internal qt libs to system qt libs folder cp -a $ANDROID_HOME/emulator/lib64/qt/lib/. /usr/lib/x86_64-linux-gnu/

Razec Luar
  • 289
  • 4
  • 18
  • This solution also works. It worked in my case. Marking someone down without trying his code is wrong – user618677 Mar 13 '18 at 20:47
  • @user618677 It is not because "it works" that it is a good answer. In this case, this answer from is (very) bad practice: you should not copy libraries from your Android emulator to your system library folder. You could erase or have conflict with critical system libraries. – Benjamin T Jul 02 '18 at 14:51
0

I got some problems with same problem. When included second lib I have got "qt not found".

Primary code added to .pro

#Add Crypto lib

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../usr/lib/x86_64-        linux-gnu/release/ -lcrypto++
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../usr/lib/x86_64-linux-gnu/debug/ -lcrypto++
    else:unix: LIBS += -L$$PWD/../../../usr/lib/x86_64-linux-gnu/ -lcrypto++

    INCLUDEPATH += $$PWD/../../../usr/include/cryptopp
    DEPENDPATH += $$PWD/../../../usr/include/cryptopp

I solved problem to change path like first ribary have and save last words "-lcrypto++"

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../build-ViCore-  Desktop_Qt_5_13_1_GCC_64bit-Debug/release/ -lcrypto++
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../build-ViCore-  Desktop_Qt_5_13_1_GCC_64bit-Debug/debug/ -lcrypto++
    else:unix: LIBS += -L$$PWD/../build-ViCore-Desktop_Qt_5_13_1_GCC_64bit-Debug/ -lcrypto++

    INCLUDEPATH += $$PWD/../build-ViCore-Desktop_Qt_5_13_1_GCC_64bit-Debug
    DEPENDPATH += $$PWD/../build-ViCore-Desktop_Qt_5_13_1_GCC_64bit-Debug
Dharman
  • 30,962
  • 25
  • 85
  • 135