PTCInc / vuforia-engine

Bug and feedback issue tracker for the Vuforia Engine SDK
https://developer.vuforia.com
20 stars 0 forks source link

Not able to build apk (even with a blank screen and no components) after importing Vuforia package in Unity #153

Open Final-Singularity opened 2 months ago

Final-Singularity commented 2 months ago

Summarize the bug: Hi, I am using unity in Windows 11. Unity version is 2022.3.44f1 LTS and the vuforia version I am using is 10.25.4. I am not able to build any project, even an empty project after importing Vuforia into Unity. An error was also observed while importing Vuforia into Unity.

Observed problem I installed Unity in Windows 11, along with all the packages that comes with 2022.3.44f1 LTS. I changed the player settings to IL2CPP and disabled vulkan settings. I tried to build a blank project and it built fine. Then while importing Vuforia, I got the following error message DeploymentOperationFailedException: Failed to find device UnityEditor.DeploymentTargets.DeploymentTargetId in 'adb devices'. UnityEditor.Android.AndroidDeploymentTargetsExtension.EnsureDeviceIsValid (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <4434f8e1cd064dbbbe9a12d676197894>:0) UnityEditor.Android.AndroidDeploymentTargetsExtension.GetTargetInfo (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <4434f8e1cd064dbbbe9a12d676197894>:0) UnityEditor.DeploymentTargets.DeploymentTargetManager.GetTargetInfo (UnityEditor.DeploymentTargets.DeploymentTargetId targetId) (at <50e19b0ed93a4256b2e454b4acec2d48>:0) UnityEditor.Android.AndroidBuildWindowExtension+<>c_DisplayClass41_0.b_0 () (at <4434f8e1cd064dbbbe9a12d676197894>:0) System.Threading.ThreadHelper:ThreadStart()

This is the log file which got generated while importing After_vuforia_import.log

Then After the import, I tried building a blank project which was building successfully before, and the following error was observed: Internal build system error. read the full binlog without getting a BuildFinishedMessage, while the backend process is still running UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

This is the log file which got generated after the build failed: After_vuforia_import_normal_build.log

Expected result Vuforia should have imported properly and the build should have finished successfully.

Other observations I was facing such issues for some time before after which I shifted to Linux. In Ubuntu, the same version of Unity is working fine with the same version of Vuforia, but since I was not able to import Area Targets since linux support is not present, I had to switch back to windows. Please note that due to some Unity issues, I had to open Unity in Administrator mode because without that, I was getting the following error even without importing Vuforia. After running in admin mode, this error vanished and I was able to build properly.

Internal build system error. read the full binlog without getting a BuildFinishedMessage, while the backend process is still running UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Reproducible steps Steps to reproduce the behavior:

  1. Open Unity in admin mode, Create new project
  2. Change Player settings to IL2CPP,
  3. Import Vuforia

Affected Vuforia Engine version: 10.25.4

Affected platform: Windows 11

ptc-epassaro commented 2 months ago

Hi @Final-Singularity, all the errors I can see in your logs seem to be related to the device you're trying to install the app on and not to Vuforia. In the logs it says that the build is successful, it just cannot install the app on the device. Which version of Android do you have installed on your device? Keep in mind that Vuforia requires at least Android 8.0 Oreo (API 26).

If you already built and installed an app with the same name on your device, you can try to uninstall that first and then build again. If that still doesn't work, you could try to follow the steps pointed out by others on this post on SO: https://stackoverflow.com/questions/36825172/no-android-device-found-in-unity

Regarding the error on import, I don't see anything in your logs. Could you maybe point out the error you are referring to?

Final-Singularity commented 2 months ago

Hi @ptc-epassaro , thank you for your reply. I am trying to build it on a device that has Android version 11 (specifically 11 RP1A.200720.011), also I had set the minimum API level to Android 8.0. As I mentioned, even before installing Vuforia, I tried to build an empty project with a single 3D object with the same Player settings (Minimum API level as Android 8.0) and it got built successfully. So I suspect it might not be an android version issue

  1. Regarding the Import fail -- You can search with the following line in this log:
    After_vuforia_import.log

DeploymentOperationFailedException: Failed to find device UnityEditor.DeploymentTargets.DeploymentTargetId in 'adb devices'. UnityEditor.Android.AndroidDeploymentTargetsExtension.EnsureDeviceIsValid

  1. Regarding the Build -- I can see the Build Failed message in this log: After_vuforia_import_normal_build.log

You can search for this error message: Build completed with a result of 'Failed' in 242 seconds (242028 ms)

Can you please check this.

ptc-epassaro commented 2 months ago

@Final-Singularity I will try to reproduce the issue on my side. In the meantime, could you please try the following?

  1. Close Unity and delete the Library folder of you project, then retry to build
  2. If it doesn't work, create a new project from scratch and make sure that there are not spaces in your project path, as those can always cause issues with Unity on Windows (I see that your project is in a folder called "Unity Projects")

Other options are the usual, so restarting your PC or reinstalling Unity.

From the logs, it looks like it might be an issue with permissions or with the build being cancelled somehow:

Application update failed:
    adb: failed to install C:\Users\apoor\Documents\Unity Projects\P1\Builds\p11.apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]
Installation failed with the following output:
adb: failed to install C:\Users\apoor\Documents\Unity Projects\P1\Builds\p11.apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]

If a build is interrupted abruptly, some Unity files might get corrupted. That's also why I think deleting the Library or reinstalling Unity might be necessary. One more thing I would try is to run Unity without admin privileges. It's something that personally I never had to do and that shouldn't be necessary.

Hope this helps!

Final-Singularity commented 2 months ago

Hi @ptc-epassaro , thank you for your response, I have been trying to follow the above possible workarounds you suggested but none of them worked for me. I tried the following three approaches

  1. Delete the Library Folder
  2. Run without admin privileges
  3. Remove spaces in the Project path

Neither Individual nor a combination of these approaches worked resulting in the same error message as I have pointed in the main issue description. Here are some more logs for your reference

Log for project with steps 2 and 3 : Editor_log_P2.txt

Log for Project with steps 1, 2 and 3: Editor_log_NewProject.txt

I am not sure what to do, these issues have had me stuck for more than 6-7 months now. Any help from your side would be really great, please let me know if you are able to find something. Thank you for the support

ptc-epassaro commented 2 months ago

Hi @Final-Singularity, I'm sorry that the problem still persists. From the logs you attached I can see that in both cases you have these errors:

Field 'System.Numerics.Vector2 SixLabors.Fonts.GlyphInstance/ControlPointCollection::SecondControlPoint' from 'C:\Users\apoor\Documents\Projects\P2\Library\PackageCache\com.unity.testtools.codecoverage@1.2.6\lib\ReportGenerator\ReportGeneratorMerged.dll', exception Failed to resolve System.Numerics.Vector2

Field 'System.Numerics.Vector2 SixLabors.Fonts.GlyphInstance/ControlPointCollection::ThirdControlPoint' from 'C:\Users\apoor\Documents\Projects\P2\Library\PackageCache\com.unity.testtools.codecoverage@1.2.6\lib\ReportGenerator\ReportGeneratorMerged.dll', exception Failed to resolve System.Numerics.Vector2

Field 'System.Numerics.Vector4 SixLabors.ImageSharp.ComplexVector4::Real' from 'C:\Users\apoor\Documents\Projects\P2\Library\PackageCache\com.unity.testtools.codecoverage@1.2.6\lib\ReportGenerator\ReportGeneratorMerged.dll', exception Failed to resolve System.Numerics.Vector4

Field 'System.Numerics.Vector4 SixLabors.ImageSharp.ComplexVector4::Imaginary' from 'C:\Users\apoor\Documents\Projects\P2\Library\PackageCache\com.unity.testtools.codecoverage@1.2.6\lib\ReportGenerator\ReportGeneratorMerged.dll', exception Failed to resolve System.Numerics.Vector4

Field 'System.Numerics.Vector4 SixLabors.ImageSharp.Formats.Jpeg.Components.Block8x8F::V0L' from 'C:\Users\apoor\Documents\Projects\P2\Library\PackageCache\com.unity.testtools.codecoverage@1.2.6\lib\ReportGenerator\ReportGeneratorMerged.dll', exception Failed to resolve System.Numerics.Vector4

Field 'System.Numerics.Vector4 SixLabors.ImageSharp.Formats.Jpeg.Components.Block8x8F::V0R' from 'C:\Users\apoor\Documents\Projects\P2\Library\PackageCache\com.unity.testtools.codecoverage@1.2.6\lib\ReportGenerator\ReportGeneratorMerged.dll', exception Failed to resolve System.Numerics.Vector4

Field 'System.Numerics.Vector4 SixLabors.ImageSharp.Formats.Jpeg.Components.Block8x8F::V1L' from 'C:\Users\apoor\Documents\Projects\P2\Library\PackageCache\com.unity.testtools.codecoverage@1.2.6\lib\ReportGenerator\ReportGeneratorMerged.dll', exception Failed to resolve System.Numerics.Vector4
[...]

Have you tried reinstalling Unity too? The fact that something cannot find symbols in System.Numerics makes me thing that something is wrong with your Unity or Visual Studio setup. It's going to take a while, but try to completely uninstall both Unity and the Unity Hub, restart your PC and reinstall. Maybe also double check your Visual Studio setup and make sure that you have installed all the components that Unity needs, including NuGet package manager.

Hope this works!

Final-Singularity commented 2 months ago

Hi @ptc-epassaro , Thank you for your response, There are a few more things I'd like to share, I saw that there were messages like these in the above logs that I shared,

Local Tarball packages: com.ptc.vuforia.engine@file:C:\Users\apoor\Documents\Projects\P2\Packages\com.ptc.vuforia.engine-10.25.4.tgz (location: C:\Users\apoor\Documents\Projects\P2\Library\PackageCache\com.ptc.vuforia.engine@b724a8714d15) [Package Manager] Deprecated packages found in project: com.ptc.vuforia.engine: This package is no longer supported on this editor version.

However, the same editor version had worked in Linux for this vuforia engine version. So I'm not sure if it is really a compatibility problem

Also, I saw messages like these: "C:/Users/apoor/Documents/Projects/P2/Library/Bee/artifacts/Android/il2cppOutput/cpp/Generics__7.cpp"" errno: 0 (No error) GetLastError: 5 (0x00000005): Access is denied.

I tried changing the permission of il2cppOutput folder by going to "Give access to --> Everyone" but that also did not work, I can see similar errors again.

Regarding Unity Installation, I have tried to re-install it several times with different editor versions but same issue persisted. I will try to do it again as you mentioned and make sure to install the NuGet package manager. Please let me know if you are able to get any more clues from your end.

Thanks a lot for all the help!

ptc-epassaro commented 2 months ago

@Final-Singularity, I also saw the deprecation message. This is something that reappears from time to time and we have reported this to Unity. In any case, it will have no consequence on the project itself.

Regarding the permissions, maybe try to give access to Everyone to the entire project folder, then try to build the project in a subfolder.