Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.2-dev4 C# export to Android generates the APK fine, but fails finding .NET assemblies for arm64 at runtime #81852

Closed
Oyama-Oyama opened this issue Sep 18, 2023 · 13 comments · Fixed by #83422

Comments

@Oyama-Oyama
Copy link

Oyama-Oyama commented Sep 18, 2023

Godot version

4.2 dev 4

System information

mac 12.6.7

Issue description

Screenshot_2023-09-20-15-48-42-963_org godotengine godot
Why is this? What can I do to fix it?

Steps to reproduce

.

Minimal reproduction project

godot.zip

@akien-mga
Copy link
Member

I assume you're actually testing 4.2 dev 4? 4.1 doesn't support Android for C# exports.

@Oyama-Oyama
Copy link
Author

I assume you're actually testing 4.2 dev 4? 4.1 doesn't support Android for C# exports.

Sorry, it's actually 4.2 dev 4

@akien-mga akien-mga changed the title On version 4.1dev4, the C# version exports the apk and fails 4.2-dev4 C# export to Android generates the APK fine, but fails finding .NET assemblies for arm64 at runtime Sep 18, 2023
@raulsntos
Copy link
Member

Your MRP doesn't contain a C# project.

@akien-mga
Copy link
Member

Your MRP doesn't contain a C# project.

So it might be the old issue where exporting a non-C# project with a .NET enabled build still tries to initialize .NET but doesn't copy the libraries?

@arnilsenarthur
Copy link

The same thing here, i cant build the project:

C:\Users\AORUS\Documents\MyRPGGodot\MyRPG-Godot.csproj : error NU1102: Unable to find package Microsoft.NETCore.App.Runtime.linux-bionic-arm64 with version (= 6.0.18)
C:\Users\AORUS\Documents\MyRPGGodot\MyRPG-Godot.csproj : error NU1102: - Found 24 version(s) in nuget.org [ Nearest version: 7.0.0-preview.5.22301.12 ]
C:\Users\AORUS\Documents\MyRPGGodot\MyRPG-Godot.csproj : error NU1102: - Found 0 version(s) in Microsoft Visual Studio Offline Packages

And i cant install the nuget either cause it's not compatible with the project.
OS: WINDOWS 11

@arnilsenarthur
Copy link

Justing to give more information:
I'm using godot 4.2.dev4-mono
.net7.0 as recommended

Error:
"C:\Users\AORUS\Documents\MyRPGGodot\MyRPG-Godot.csproj" (Restore target) (1) ->
(Restore target) ->
C:\Users\AORUS\Documents\MyRPGGodot\MyRPG-Godot.csproj : error NU1102: Unable to find package Microsoft.NETCore.App.Runtime.linux-bionic-arm64 with version (= 6.0.18)
C:\Users\AORUS\Documents\MyRPGGodot\MyRPG-Godot.csproj : error NU1102: - Found 24 version(s) in nuget.org [ Nearest version: 7.0.0-preview.5.22301.12 ]
C:\Users\AORUS\Documents\MyRPGGodot\MyRPG-Godot.csproj : error NU1102: - Found 0 version(s) in Microsoft Visual Studio Offline Packages

0 Warning(s)
1 Error(s)

I can't build any architectures of android apk

@raulsntos
Copy link
Member

So it might be the old issue where exporting a non-C# project with a .NET enabled build still tries to initialize .NET but doesn't copy the libraries?

I slightly remember something like that but I can't find the issue now, I don't remember if it was resolved. It shouldn't copy any .NET libraries if there is no C# project, but then the exported project shouldn't attempt to load them, otherwise you can't export GDScript-only projects from the .NET version (this will become more important with Editor unification, maybe #74089 already solves this).


@arnilsenarthur You have to target .NET 7.0. Change <TargetFramework>net6.0</TargetFramework> in the .csproj file to <TargetFramework>net7.0</TargetFramework> and make sure you have the 7.0 SDK installed. Also, I believe only arm64 works at the moment.

@arnilsenarthur
Copy link

I already did this and still not worked.
after i added <UseMonoRuntime>true</UseMonoRuntime> it worked, but the app opens, then turn black and crashes.
tested on android device emulator and on a real device

@arnilsenarthur
Copy link

Yep, i give up by now. I created a empty project in a non-mono godot version then it installed and worked with no problems. but even an empty mono android project does not work

@rekliner
Copy link

Same experience here with the unmodified XR Tools demo and 4.2dev4. Loads ok non-mono. As you suspected @raulsntos I had not added any C# code yet.

@arnilsenarthur
Copy link

Using android studio log i tried to understand what's wrong and seems something about vulkan, but i'm not sure.
I asked at discord if it's viable to use C# in a project aiming to launch it to mobile/desktop by december or should I just use gdscript, even when if i need to rewrote some code, I'll wait for the answer and halt my production for a while. But anyway if you need more info about the issue just ask and I'll send it here

@maagy
Copy link

maagy commented Oct 12, 2023

This is logcat output from android emulator running simple godot application exported by v4.2.dev6.mono.official.57a6813bb (filtered by godot keyword):

2023-10-12 08:49:16.192  4361-4361  VkThread                org.godotengine.asrnior              W  type=1400 audit(0.0:25): avc:  denied  { getattr } for  path="/dev/pmsg0" dev="tmpfs" ino=476 scontext=u:r:untrusted_app_32:s0:c183,c256,c512,c768 tcontext=u:object_r:pmsg_device:s0 tclass=chr_file permissive=0 app=org.godotengine.asrnior
2023-10-12 08:49:16.200  4361-4382  OpenGLRenderer          org.godotengine.asrnior              W  Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2023-10-12 08:49:16.200  4361-4382  OpenGLRenderer          org.godotengine.asrnior              W  Failed to initialize 101010-2 format, error = EGL_SUCCESS
2023-10-12 08:49:16.251  4361-4382  Gralloc4                org.godotengine.asrnior              I  mapper 4.x is not supported
2023-10-12 08:49:16.293  4361-4382  OpenGLRenderer          org.godotengine.asrnior              E  Unable to match the desired swap behavior.
2023-10-12 08:49:16.317   608-631   system_server           system_server                        W  Failed to determine oat file name for dex location /data/app/~~brT5NzBMU8SEedvIiU1OVg==/org.godotengine.asrnior-bLl63rh_OlgvSZVuKXd-tA==/base.apk: Dalvik cache directory does not exist
2023-10-12 08:49:16.317   608-631   ziparchive              system_server                        W  Unable to open '/data/app/~~brT5NzBMU8SEedvIiU1OVg==/org.godotengine.asrnior-bLl63rh_OlgvSZVuKXd-tA==/base.dm': No such file or directory
2023-10-12 08:49:16.320   608-631   ActivityTaskManager     system_server                        I  Displayed org.godotengine.asrnior/com.godot.game.GodotApp for user 0: +2s193ms
2023-10-12 08:49:16.332   608-628   ImeTracker              system_server                        I  org.godotengine.asrnior:be514516: onRequestHide at ORIGIN_SERVER_HIDE_INPUT reason HIDE_UNSPECIFIED_WINDOW
2023-10-12 08:49:16.333   608-628   ImeTracker              system_server                        I  org.godotengine.asrnior:be514516: onCancelled at PHASE_SERVER_SHOULD_HIDE
2023-10-12 08:49:16.337  1586-1586  GoogleInpu...hodService com...gle.android.inputmethod.latin  I  GoogleInputMethodService.onStartInput():1877 onStartInput(EditorInfo{inputType=0x0(NULL) imeOptions=0x0 privateImeOptions=null actionName=UNSPECIFIED actionLabel=null actionId=0 initialSelStart=-1 initialSelEnd=-1 initialCapsMode=0x0 hintText=null label=null packageName=org.godotengine.asrnior fieldId=0 fieldName=null extras=null}, false)
2023-10-12 08:49:16.693   608-2847  CoreBackPreview         system_server                        D  Window{339b87a u0 Splash Screen org.godotengine.asrnior EXITING}: Setting back callback null
2023-10-12 08:49:16.693   608-628   InputManager-JNI        system_server                        W  Input channel object '339b87a Splash Screen org.godotengine.asrnior (client)' was disposed without first being removed with the input manager!
2023-10-12 08:49:17.956  4361-4400  platform                org.godotengine.asrnior              E  Failed to open rendernode: No such file or directory
2023-10-12 08:49:17.956  4361-4400  androidemu              org.godotengine.asrnior              I  HealthMonitor enabled. Returning monitor.
2023-10-12 08:49:17.974  4361-4400  vulkan                  org.godotengine.asrnior              D  searching for layers in '/data/app/~~brT5NzBMU8SEedvIiU1OVg==/org.godotengine.asrnior-bLl63rh_OlgvSZVuKXd-tA==/lib/arm64'
2023-10-12 08:49:17.974  4361-4400  vulkan                  org.godotengine.asrnior              D  searching for layers in '/data/app/~~brT5NzBMU8SEedvIiU1OVg==/org.godotengine.asrnior-bLl63rh_OlgvSZVuKXd-tA==/base.apk!/lib/arm64-v8a'
2023-10-12 08:49:17.990  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR
2023-10-12 08:49:17.991  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCmdSetAttachmentFeedbackLoopEnableEXT
2023-10-12 08:49:17.991  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCmdSetDepthBias2EXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCmdSetDiscardRectangleEnableEXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCmdSetDiscardRectangleModeEXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCopyImageToImageEXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCopyImageToMemoryEXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCopyMemoryToImageEXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkTransitionImageLayoutEXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCmdBindShadersEXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCreateShadersEXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkDestroyShaderEXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkGetShaderBinaryDataEXT
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCmdDrawClusterHUAWEI
2023-10-12 08:49:17.992  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCmdDrawClusterIndirectHUAWEI
2023-10-12 08:49:17.994  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCmdBindIndexBuffer2KHR
2023-10-12 08:49:17.994  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkGetDeviceImageSubresourceLayoutKHR
2023-10-12 08:49:17.994  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkGetImageSubresourceLayout2KHR
2023-10-12 08:49:17.994  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkGetRenderingAreaGranularityKHR
2023-10-12 08:49:17.994  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkMapMemory2KHR
2023-10-12 08:49:17.994  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkUnmapMemory2KHR
2023-10-12 08:49:17.995  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCmdUpdatePipelineIndirectBufferNV
2023-10-12 08:49:17.995  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkGetPipelineIndirectDeviceAddressNV
2023-10-12 08:49:17.995  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkGetPipelineIndirectMemoryRequirementsNV
2023-10-12 08:49:17.995  4361-4400  ndk_translation         org.godotengine.asrnior              E  Unknown function is used with vkGetInstanceProcAddr: vkCmdSetExclusiveScissorEnableNV
2023-10-12 08:49:18.007  4361-4400  godot                   org.godotengine.asrnior              I  Vulkan API 1.1.0 - Forward Mobile - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 3060 Laptop GPU
2023-10-12 08:49:18.123  4361-4400  vulkan                  org.godotengine.asrnior              D  vkCreateImage w/ native buffer failed: 4294967293
2023-10-12 08:49:18.124  4361-4400  godot                   org.godotengine.asrnior              E  USER ERROR: Condition "err" is true. Returning: ERR_CANT_CREATE
2023-10-12 08:49:18.124  4361-4400  godot                   org.godotengine.asrnior              E     at: _update_swap_chain (drivers/vulkan/vulkan_context.cpp:2051)
2023-10-12 08:49:18.125  4361-4400  godot                   org.godotengine.asrnior              E  USER ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
2023-10-12 08:49:18.125  4361-4400  godot                   org.godotengine.asrnior              E     at: _window_create (drivers/vulkan/vulkan_context.cpp:1770)
2023-10-12 08:49:18.126  4361-4400  godot                   org.godotengine.asrnior              E  USER ERROR: Failed to create Vulkan window.
--------- beginning of crash
2023-10-12 08:49:18.126  4361-4400  godot                   org.godotengine.asrnior              E     at: DisplayServerAndroid (platform/android/display_server_android.cpp:583)
2023-10-12 08:49:18.157  4361-4400  libc                    org.godotengine.asrnior              A  Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x0 in tid 4400 (VkThread), pid 4361 (tengine.asrnior)
2023-10-12 08:49:18.438  4419-4419  DEBUG                   pid-4419                             A  Cmdline: org.godotengine.asrnior
2023-10-12 08:49:18.438  4419-4419  DEBUG                   pid-4419                             A  pid: 4361, tid: 4400, name: VkThread  >>> org.godotengine.asrnior <<<
2023-10-12 08:49:18.452   608-4424  ActivityManager         system_server                        E  App crashed on incremental package org.godotengine.asrnior which is 100% loaded.

@sanform
Copy link

sanform commented Nov 7, 2023

I'm seeing the same error in my project. I'm using the PlayFab C# SDK. It seems to happen on a call to that library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants