Qt for Android 和 ARCore 应用冲突

huangapple go评论92阅读模式
英文:

Qt for Android and ARCore Application Clashes

问题

我正在尝试使用Qt创建一个针对Android的ARCore应用程序。

我能够运行ARCore示例(hello_ar_java,hello_ar_c)和Qt示例(jnimessenger)。但是当它们一起运行时,会崩溃。

我从Qt JNI Messenger示例开始。然后我从Qt模板目录(~/Qt/5.15.0/android/src/android/templates/build.gradle)中添加了build.gradle。接着我在dependencies中添加了implementation 'com.google.ar:core:1.18.0'

但是它崩溃并显示以下错误。

我想知道为什么这个依赖会破坏一开始工作的Qt。(我是Android的初学者。)

我做错了什么吗?有没有办法同时使用Qt和ARCore?

  • Qt版本:5.15.0
  • QtCreator版本:4.12.0
  • ARCore版本:1.18.0
  • Android SDK:从Android Studio 4.0.1安装
  • NDK版本:21.3.6528147
  • macOS Catalina版本:10.15.5
  • Android设备:Pixel 3a,Android 10

谢谢帮助!

英文:

I am trying to create ARCore application with Qt for Android.

I was able to run ARCore example(hello_ar_java,hello_ar_c) and Qt example(jnimessenger).
But both together, it crashes.

I started with an Qt JNI Messenger Example.
And I added build.gradle from qt template dir(~/Qt/5.15.0/android/src/android/templates/build.gradle).
Then I added implementation 'com.google.ar:core:1.18.0' to dependencies.

dependencies {
    implementation 'com.google.ar:core:1.18.0'
    implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
}

But it crashes with this error.

I le.jnimessenge: Late-enabling -Xcheck:jni
E le.jnimessenge: Unknown bits set in runtime_flags: 0x8000
W System  : ClassLoader referenced unknown path:
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libc++_shared.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libQt5Core_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libQt5AndroidExtras_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libQt5Gui_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libQt5Network_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libQt5Qml_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libQt5QmlModels_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libQt5Quick_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libQt5QmlWorkerScript_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libQt5QuickTemplates2_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libQt5QuickControls2_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libplugins_platforms_qtforandroid_armeabi-v7a.so'
I Qt JAVA : Can't find '/data/app/org.qtproject.example.jnimessenger-aiGQbBP6wlwSUCHGO1oUDA==/lib/arm64/libplugins_bearer_qandroidbearer_armeabi-v7a.so'
W System.err: java.lang.Exception:
W System.err: 	at org.qtproject.qt5.android.bindings.QtLoader.loadApplication(QtLoader.java:268)
W System.err: 	at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:505)
W System.err: 	at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:166)
W System.err: 	at org.qtproject.qt5.android.bindings.QtActivity.onCreateHook(QtActivity.java:266)
W System.err: 	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:273)
W System.err: 	at android.app.Activity.performCreate(Activity.java:7825)
W System.err: 	at android.app.Activity.performCreate(Activity.java:7814)
W System.err: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
W System.err: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
W System.err: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
W System.err: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
W System.err: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
W System.err: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
W System.err: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
W System.err: 	at android.os.Handler.dispatchMessage(Handler.java:107)
W System.err: 	at android.os.Looper.loop(Looper.java:214)
W System.err: 	at android.app.ActivityThread.main(ActivityThread.java:7356)
W System.err: 	at java.lang.reflect.Method.invoke(Native Method)
W System.err: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
W System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
I Adreno  : QUALCOMM build                   : 4a00b69, I4e7e888065
I Adreno  : Build Date                       : 04/09/19
I Adreno  : OpenGL ES Shader Compiler Version: EV031.26.06.00
I Adreno  : Local Branch                     :
I Adreno  : Remote Branch                    :
I Adreno  : Remote Branch                    :
I Adreno  : Reconstruct Branch               :
I Adreno  : Build Config                     : S P 8.0.6 AArch64
I Adreno  : PFP: 0x016ee183, ME: 0x00000000
W Gralloc3: mapper 3.x is not supported

I wonder why this dependency destroys the Qt that was working at first.(I'm a beginner at Android.)

Did I do something wrong?
Is there a way to use both Qt and ARCore at the same time?

  • Qt:5.15.0
  • QtCreator:4.12.0
  • ARCore:1.18.0
  • Android SDK:install from Android Studio 4.0.1
  • NDK:21.3.6528147
  • MacOS Catalina:10.15.5
  • Android Device:pixel 3a Android 10

Thanks for the help!

答案1

得分: 0

我不理解这个逻辑,但我已经解决了这个问题。

我选择了arm64-v8a。(项目>构建步骤>ABIs)

Qt for Android 和 ARCore 应用冲突

英文:

I don't understand the logic, but I've solved the problem.

I chose arm64-v8a. (Project>Build Step>ABIs)

Qt for Android 和 ARCore 应用冲突

huangapple
  • 本文由 发表于 2020年8月19日 17:48:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/63484308.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定