Android OpenXR-Anwendung java.io.FileNotFoundException: /apex/com.meta.xr/priv-app/VrDriver/VrDriver.apkC++

Programme in C++. Entwicklerforum
Anonymous
 Android OpenXR-Anwendung java.io.FileNotFoundException: /apex/com.meta.xr/priv-app/VrDriver/VrDriver.apk

Post by Anonymous »

Ich erstelle eine OpenXR-Anwendung, die auf einer Oculus Quest mit Android ndk läuft. Ich versuche, andere Bibliotheken einzubinden und konnte die Anwendung mit diesem cmake
einwandfrei zum Laufen bringen

Code: Select all

cmake_minimum_required(VERSION 3.6)

project(Template)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Assimp
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries" FORCE)
set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "If the test suite for Assimp is built in addition to the library." FORCE)
set(ASSIMP_INSTALL OFF CACHE BOOL "Disable this if you want to use assimp as a submodule." FORCE)
# OpenAL
set(LIBTYPE STATIC CACHE STRING "Build OpenAL as a static library" FORCE)
set(ALSOFT_TESTS OFF CACHE BOOL "Build test programs")
set(ALSOFT_EXAMPLES OFF CACHE BOOL "Build example program")
# OpenXR
set(BUILD_TESTS OFF CACHE INTERNAL "Build tests")
set(BUILD_API_LAYERS ON CACHE INTERNAL "Use OpenXR layers")

# third party submodules
add_subdirectory(${CMAKE_SOURCE_DIR}/ThirdParty/OpenXR-SDK-Source openxr_build)
add_subdirectory(${CMAKE_SOURCE_DIR}/ThirdParty/openal-soft openal_build)
add_subdirectory(${CMAKE_SOURCE_DIR}/ThirdParty/assimp assimp_build)

# Collect all .cpp files in the cpp directory
file(GLOB_RECURSE SRC_FILES ${CMAKE_SOURCE_DIR}/main/cpp/*.cpp)

add_library(${PROJECT_NAME} SHARED
${SRC_FILES}
)

set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate"
)

target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_SOURCE_DIR}/main/cpp
)

# export ANativeActivity_onCreate for java to call.
set_property(
TARGET ${PROJECT_NAME}
APPEND_STRING
PROPERTY LINK_FLAGS " -u ANativeActivity_onCreate"
)

# native_app_glue
include(AndroidNdkModules)
android_ndk_import_module_native_app_glue()

# Link libraries to your native library
target_link_libraries(${PROJECT_NAME} PRIVATE
android
EGL
GLESv3
log
native_app_glue
jnigraphics
openxr_loader
OpenAL
assimp
)
Ich sehe Folgendes im Cat-Protokoll, wenn es ausgeführt wird:

Code: Select all

ziparchive              com.example.Template                 W  Unable to open '/apex/com.meta.xr/priv-app/VrDriver/VrDriver.apk': No such file or directory
vulkan                  com.example.Template                 E  failed to open apk '/apex/com.meta.xr/priv-app/VrDriver/VrDriver.apk': -11
vulkan                  com.example.Template                 D  searching for layers in '/system/priv-app/VrDriver/VrDriver.apk!/lib/arm64-v8a'
DriverLoader            com.example.Template                 I  Calling into SetLegacyVrApiEntryPointOverride
VrApi_DriverLoader      com.example.Template                 I  SetLegacyVrApiEntryPointOverride: calling sprintf
VrApi_DriverLoader      com.example.Template                 I  SetLegacyVrApiEntryPointOverride: env buffer is '0x7634a60478'
VrApi_DriverLoader      com.example.Template                 I  SetLegacyVrApiEntryPointOverride: calling setenv
DriverLoader            com.example.Template                 I  Creating Temp JNIEnv
DriverLoader            com.example.Template                 I  Calling FindClass
DriverLoader            com.example.Template                 I  Calling RegisterNativeVrApiLoaderMethods
VrApi_DriverLoader      com.example.Template                 I  RegisterNativeVrApiLoaderMethods: calling RegisterNatives
DriverLoader            com.example.Template                 I  Calling RegisterNativeXrLoaderMethods
OpenXR_DriverLoader     com.example.Template                 I  RegisterNativeVrApiLoaderMethods: calling RegisterNatives
DriverLoader            com.example.Template                 I  Exiting JNI_OnLoad
OpenXR_ClientState      com.example.Template                 I  OpenXRClientState::create - from xrInitializeLoaderKHR
XrRuntimeS...lientState com.example.Template                 I  SharedClientState::create called from 'OpenXRClientState::init'
Es scheint keinen Zugriff auf /apex/com.meta.xr/priv-app/VrDriver/VrDriver.apk zu haben, es kann aber von / aus geöffnet werden. system/priv-app/VrDriver/VrDriver.apk!/lib/arm64-v8a
Aber wenn ich OpenAL aus dem cmake entferne (und alle Referenzen im cpp-Code), löschen Sie die .cxx- und Build-Ordner, um einen sauberen Build zu erzwingen. Das Projekt wird erstellt, stürzt jedoch ab und zeigt dies im Protokoll an.

Code: Select all

---------------------------- PROCESS STARTED (30599) for package com.example.Template ----------------------------
com.example.Template                 W  Entry not found
com.example.Template                 W  Entry not found
com.example.Template                 W  Warning: unable to resolve "/apex/com.meta.xr/priv-app/VrDriver/VrDriver.apk": No such file or directory (ignoring)
com.example.Template                 W  JIT profile information will not be recorded: profile file does not exist.
com.example.Template                 W  JIT profile information will not be recorded: profile file does not exist.
com.example.Template                 V  ANGLE Developer option for 'com.example.Template' set to: 'default'
com.example.Template                 V  ANGLE GameManagerService for com.example.Template: false
com.example.Template                 V  Neither updatable production driver nor prerelease driver is supported.
com.example.Template                 D  Compat change id reported: 175409949; UID 10152; state: DISABLED
com.example.Template                 D  Compat change id reported: 175409951; UID 10152; state: ENABLED
com.example.Template                 D  Compat change id reported: 175409956; UID 10152; state: DISABLED
com.example.Template                 D  Compat change id reported: 175409950; UID 10152; state: DISABLED
com.example.Template                 D  No Network Security Config specified, using platform default
com.example.Template                 D  Compat change id reported: 175409952; UID 10152;  state: DISABLED
com.example.Template                 D  No Network Security Config specified, using platform default
---------------------------- PROCESS ENDED (30599) for package com.example.Template ----------------------------
com.example.Template                 E  Unable to open zip file: /apex/com.meta.xr/priv-app/VrDriver/VrDriver.apk
com.example.Template                 E  java.io.FileNotFoundException: /apex/com.meta.xr/priv-app/VrDriver/VrDriver.apk (No such file or directory)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:265)
at java.util.zip.ZipFile.(ZipFile.java:187)
at java.util.jar.JarFile.(JarFile.java:169)
at java.util.jar.JarFile.(JarFile.java:106)
at libcore.io.ClassPathURLStreamHandler.(ClassPathURLStreamHandler.java:46)
at dalvik.system.DexPathList$NativeLibraryElement.maybeInit(DexPathList.java:858)
at dalvik.system.DexPathList$NativeLibraryElement.findNativeLibrary(DexPathList.java:879)
at dalvik.system.DexPathList.findLibrary(DexPathList.java:594)
at dalvik.system.BaseDexClassLoader.findLibrary(BaseDexClassLoader.java:301)
at android.app.NativeActivity.onCreate(NativeActivity.java:160)
at android.app.Activity.performCreate(Activity.java:8068)
at android.app.Activity.performCreate(Activity.java:8048)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1341)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3705)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3881)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2270)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:214)
at android.os.Looper.loop(Looper.java:304)
at android.app.ActivityThread.main(ActivityThread.java:7918)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1010)
com.example.Template                 D  Shutting down VM
Es scheint /apex/com.meta.xr/priv-app/VrDriver/VrDriver.apk nicht zu finden und es wird nicht einmal versucht, danach zu suchen /system/priv-app/VrDriver/VrDriver.apk!/lib/arm64-v8a wie wenn OpenAL enthalten ist. Ich verstehe nicht, warum die Nichteinbeziehung von OpenAL dieses Problem verursachen würde. Es scheint, dass ich, wenn ich assimp einbinde, auch OpenAL einbinden muss, sonst erhalte ich die Fehlermeldung. Wenn ich Assimp und OpenAL ausschließe, läuft die App einwandfrei.
Ich habe ein paar vorübergehende Problemumgehungen, wie zum Beispiel mit OpenAL erstellen, es dann aus dem cmake entfernen und erneut erstellen, ohne .cxx und Build-Ordner zu löschen Ich würde dieses Problem gerne beheben.
Ich würde mich über jeden Rat freuen, wie ich das Problem beheben kann oder welche Änderungen ich an meinem Projekt vornehmen kann, um das Problem zu beheben. Ich kann die AndroidManifest- und Gradle-Dateien einschließen, wenn dies zur Behebung dieses Problems beitragen kann.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post